Bash 文件夹上传 FTP

发布于 2024-11-05 19:09:38 字数 298 浏览 0 评论 0原文

我正在尝试通过 FTP 和 bash 将文件夹上传到我的网站,但我似乎无法让它工作。我已经安装了 wput 和一个名为 ncftpput 的东西,但两者似乎都不起作用。我只想将整个文件夹复制到远程服务器。这是我的文件夹路径,如果有帮助的话。

ftp.example.com/subdomains/cydia
/theme_builder/upload/

类似于用于目录的 put 命令 put 的东西会很好用。我也不知道如何在 bash 中很好地使用 ftp 。 到目前为止,这个网站还没有让我失望,所以提前感谢!

I'm trying to upload a folder to my website preferably via FTP and bash, but I can't seem to get this to work. I've installed wput and something called ncftpput and both don't seem to work. I just want to copy the entire folder to a remote server. Here's my folder paths if that will help.

ftp.example.com/subdomains/cydia
/theme_builder/upload/

Something similar to a put command put for directories would work well. I don't know how to use ftp in bash very well either.
So far this site hasn't failed me yet, so thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ヅ她的身影、若隐若现 2024-11-12 19:09:38

您是否有足够的服务器访问权限来解压文件?

如果是这样,我会将其压缩、传输并解压缩。

Do you have sufficent access to the server to untar a file?

If so i would tar it up, transfer it and untar it.

拥醉 2024-11-12 19:09:38

您可以使用 ncftpput。看一下 -R 选项(递归)。从手册页:

You can upload an entire directory tree of files by using the -R  flag.
   Example:

  $ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff

   This would create a /incoming/stuff hierarchy on the remote host.

You can use ncftpput. Have a look at the -R option (recursive). From the man page:

You can upload an entire directory tree of files by using the -R  flag.
   Example:

  $ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff

   This would create a /incoming/stuff hierarchy on the remote host.
桜花祭 2024-11-12 19:09:38

或者您可以简单地使用 curlftpfs 和(有一些小注意事项1) 执行您在本地文件系统上执行的任何操作。

Curlftpfs 是一个熔丝文件系统,可在 ftp 传输上工作,就像 sshfs(或 sftp)在 ssh 上工作一样。这样,您就可以像普通文件系统一样将 ftp 服务器目录挂载到本地挂载点上。您可以执行所有正常操作,例如使用 findtouchcp -rrsync -hxDPavilyzH --stats --delete 甚至只是 tar

哦,我建议使用适当保护的~/.netrc来存储凭据。

1 如果您不记得它将使用 ftp 进行传输,某些操作当然会比必要的慢

Or you can simply use curlftpfs and (with minor caveats1) do whatever you'd do on your local filesystem.

Curlftpfs is a fuse filesystem that works on ftp transport like sshfs (or sftp) works over ssh. This way, you can mount a ftp server directory on a local mountpoint like a normal filesystem. You can do all normal opeationsike, e.g. use find, touch, cp -r, rsync -hxDPavilyzH --stats --delete or even just tar.

Oh, I recommend using a suitably protected ~/.netrc to store the credentials.

1 some operations will of course be slower than necessary if you don't remember that it's going to use ftp for the transport

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文