有问题。我需要使用linux bash将文件上传到远程ftp服务器。 不适合这样:cp file.tar.gz ftp://username:[email protected]/file.tar.gz
可以这样做吗?将文件上传到远程服务器
在此先感谢,亚历克斯
有问题。我需要使用linux bash将文件上传到远程ftp服务器。 不适合这样:cp file.tar.gz ftp://username:[email protected]/file.tar.gz
可以这样做吗?将文件上传到远程服务器
在此先感谢,亚历克斯
我会用http://www.ncftp.com/这一点。
// see comment => “具体来说,看看ncftpput。”
你可以使用普通的ftp + bash来做这个。
bash脚本开始:
echo“put $ 1”> commands.txt;
echo“quit”>> commands.txt;
FTP用户@ FTP://用户名:密码@主机< commands.txt中
bash脚本结束。
把它放在ftp.sh中。运行它像./ftp.sh file.tar.gz.这将上传到FTP服务器。
具体来说,看看[ncftpput](http://www.ncftpd.com/ncftp/doc/ncftpput.html)。 – 2011-02-02 22:11:08