项目环境配置相同,目录文件在各系统中一致
1.要上传的文件目录写到test
- /data/www/wwwroot/test.com/www/app/design/frontend/default/ddl_new/template/customer/account/navigation.phtml
- /data/www/wwwroot/test.com/www/app/design/frontend/default/ddl_new/template/ticket
- /data/www/wwwroot/test.com/www/app/design/frontend/default/ddl_new/layout/customer.xml
- /data/www/wwwroot/test.com/www/app/code/local/test/Ticket
- /data/www/wwwroot/test.com/www/skin/frontend/default/ddl_new/css/mypoint.css
file_upload.sh
- #!/bin/sh
- #./file_upload.sh test 192.168.1.13
- DATE=`date +%Y_%m_%d_%H`
- #alias scp='scp -P 56789'
- HOST=root@$2
- if [ $1 ]
- then
- for file in $(sed '/^$/d' $1)
- do
- if [ -f $file ]
- then
- res=`scp $file $HOST:$file`
- if [ -z $res ]
- then
- echo "$file succes"
- #echo $file >> ${DATE}_upload.log
- else
- echo "$file error"
- fi
- elif [ -d $file ]
- then
- res=`scp -r $file $HOST:$file`
- if [ -z $res ]
- then
- #echo $file >> ${DATE}_upload.log
- echo "$file succse"
- else
- echo "$file error"
- fi
- else
- echo "error file $file"
- fi
- done
- else
- echo "no file"
- fi
多个