自动上传文件脚本

貌似做开发,linux也是必备的技能了、、、
 
scp.sh
expect -c "
        set timeout 2200;
        spawn scp -r -P 22 $1 $2@$3:$4
        expect {
                \"*yes/no*\" {send \"yes\r\"; exp_continue}
                \"*password*\" {send \"$5\r\";}
        }
expect eof;"
 
使用 : ./scp.sh index.html  root  110.54.94.222 /data/ 'edfasdads'     (密码中有括号所以增加单引号)
posted @ 2012-07-08 03:52  jiang nan  阅读(511)  评论(0编辑  收藏  举报