文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Linux Ftp mput 命令示例

Linux Ftp mput 命令示例

时间:2010-11-15  来源:刘政道

#!/bin/sh
#cd
ftp -n -i 192.168.0.1 <<EOF
user username userpassword
passive
cd /jbpm
prompt
prompt
mput /var/lib/mysql/jbpm/*.* jbpm2010
quit
EOF

exit

 

 结果FileZilla报550错.

(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> STOR /var/lib/mysql/jbpm/qdcm_pow_items.frm
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 550 Filename invalid
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> PORT 192,168,0,1,36,148
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 200 Port command successful
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> STOR /var/lib/mysql/jbpm/qdcm_pow_sh.frm
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 550 Filename invalid
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> PORT 192,168,0,1,36,149
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 200 Port command successful
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> STOR /var/lib/mysql/jbpm/qdcm_tool_note.frm
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 550 Filename invalid
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> PORT 192,168,0,1,36,150
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 200 Port command successful
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> STOR /var/lib/mysql/jbpm/test.frm
(000026) 2010-11-15 10:48:12 - dai (10.130.129.11)> 550 Filename invalid 

 

尝试了好多把后,在网上搜了N吧,可能原因是路径/var/lib/mysql/jbpm/*.*,在脚本前加入 cd /var/lib/mysql/jbpm/,然后再mput *.* 就不报错了。原来FileZilla默认将/var/lib/mysql/jbpm/作为保存路径,在FTP服务器上自然就找不到这个路径。修改后就不报错了。

 

在Linux代码中使用prompt的目的是将Interactive mode 设置成off,这样的话在传文件时就不会有询问yes/no对话框。

每次使用prompt时,Interactive mode的状态就会改变,prompt on 或 off命令不起作用,并不能达到预期效果。


 

 

 

 

 


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载