1. 程式人生 > >ssh 遠端刪除,scp遠端拷貝

ssh 遠端刪除,scp遠端拷貝

ssh 遠端刪除

expect -c "
spawn ssh -t user@IP rm -fr ~/daily_binary/dailybuildapks/*
expect {
\"*assword\" {set timeout 300; send \"password\r\";}
\"yes/no\" {send \"yes\r\"; exp_continue;}
}
expect eof"

scp 遠端拷貝

expect -c "
spawn scp -r /home/jenkins/ [email protected]:~/daily_binary/dailybuildapks/
expect {
\"*assword\" {set timeout 300; send \"password\r\";}
\"yes/no\" {send \"yes\r\"; exp_continue;}
}
expect eof"