Bash 文件夹上传 FTP
我正在尝试通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否有足够的服务器访问权限来解压文件?
如果是这样,我会将其压缩、传输并解压缩。
Do you have sufficent access to the server to untar a file?
If so i would tar it up, transfer it and untar it.
您可以使用 ncftpput。看一下 -R 选项(递归)。从手册页:
You can use ncftpput. Have a look at the -R option (recursive). From the man page:
或者您可以简单地使用
curlftpfs
和(有一些小注意事项1) 执行您在本地文件系统上执行的任何操作。Curlftpfs 是一个熔丝文件系统,可在 ftp 传输上工作,就像 sshfs(或 sftp)在 ssh 上工作一样。这样,您就可以像普通文件系统一样将 ftp 服务器目录挂载到本地挂载点上。您可以执行所有正常操作,例如使用
find
、touch
、cp -r
、rsync -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 justtar
.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