1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# /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
}
|
本文转自birdinroom 51CTO博客,原文链接:http://blog.51cto.com/birdinroom/1402105,如需转载请自行联系原作者