勉输密码传输文件case

来源:互联网 发布:阿里云备案域名介入 编辑:程序博客网 时间:2024/05/21 15:01
#!/usr/bin/expect
set password "L2%zOoEb"
#set password conbiz0525


#download
spawn scp -P8022 convstcn@103.234.120.108:/opt/storage-swiftlive/business/*  /opt/storage/log/2blive/ready/business_log/
#spawn scp conversant@192.168.5.2:/opt/app/keepalived/install-sh  /opt/app
set timeout 300
#expect "Are you sure you want to continue connecting (yes/no)?"
#send "yes\r"


expect "convstcn@103.234.120.108's password:"
#expect "conversant@192.168.5.2's password:"


set timeout 300
send "$password\r"
set timeout 300
send "exit\r"
expect eof
0 0
原创粉丝点击