jiao_ben/expect/expect_scp.sh
2021-06-28 21:49:23 +08:00

11 lines
247 B
Bash

#!/usr/bin/expect -f
set ip [lindex $argv 0]
set timeout 1200
spawn /usr/bin/scp -r 192.168.10.10:/data/www/ /data/
expect {
"(yes/no)?" {send "yes\r"}
"*password:" {send "www.aqzt.com\r"}
}
expect "password:"
send "123456\r"