# /bin/bash# creator:lihuibin# date : 2014-03-10 16:45# desc : upload file to ftphosts="192.168.56.100"port=21user=testpass=testpwdwork_path="/var/www/cms"packname="publish"#hosts=$1#port=$2#user=$3#pass=$4#packname=$6#work_path=$5cd $work_path/usr/bin/zip -r $packname *[ -f "$work_path/$packname" ] &&{ftp -n<<!open $hosts $porttype binaryuser $user $passcd /uploadlcd $work_pathpromptput $packnameclosebye!rm -f $packname} |
