#!/usr/bin/expect -f set dtime [lindex $argv 0 ] set password 111111 set timeout 3000; spawn /usr/bin/scp /software/databk/$dtime.sql [email protected]:/software/mysqldata/ #spawn ssh [email protected] expect { "*yes/no" {send "yes\r";exp_continue} "*password:" {send "$password\r"} } interact
时间: 2024-10-23 02:11:01