• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    Shell脚本实现上传zip压缩文件到FTP服务器

    复制代码 代码如下:

    # /bin/bash
    # creator:lihuibin
    # date : 2014-03-10 16:45
    # desc : upload file to ftp
    hosts="192.168.56.100"
    port=21
    user=test
    pass=testpwd
    work_path="/var/www/cms"
    packname="publish"
    #hosts=$1
    #port=$2
    #user=$3
    #pass=$4
    #packname=$6
    #work_path=$5
    cd $work_path
    /usr/bin/zip -r $packname *
    [ -f "$work_path/$packname" ] {
    ftp -n!
    open $hosts $port
    type binary
    user $user $pass
    cd /upload
    lcd $work_path
    prompt
    put $packname
    close
    bye
    !
    rm -f $packname
    }

    您可能感兴趣的文章:
    • shell脚本学习之调用脚本将文件打包zip的方法示例
    上一篇:Shell脚本查看网卡实时流量
    下一篇:CentOS下mysql定时备份Shell脚本分享
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    Shell脚本实现上传zip压缩文件到FTP服务器 Shell,脚本,实现,上传,zip,