zoukankan      html  css  js  c++  java
  • Linux Ftp mput 命令示例

    在Linux 下写了一个脚本

    #!/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命令不起作用,并不能达到预期效果。


  • 相关阅读:
    《网络》:关于计算机网络的必备常识【无序】(不定时更新)
    《网络》:设置三个密码:通过console口连接设备,进入特权模式,登录Telnet
    《网络》:交换机基本配置命令
    启动eclipse时出现“Failed to load the JNI shared library jvm.dll”错误及解决
    java之servlet小记
    Nokia大事录
    Android之HandlerThread
    Android进程间的通信之AIDL
    Android进程间的通信之Messenger
    Loaders
  • 原文地址:https://www.cnblogs.com/liuzhengdao/p/1877476.html
Copyright © 2011-2022 走看看