华域联盟 linux shell Shell脚本实现上传zip压缩文件到FTP服务器

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压缩文件到FTP服务器

转载请保留出处和原文链接:https://www.cnhackhy.com/16392.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部