自动化 scp 上传文件

自动化 scp 上传文件

#!/usr/bin/expect

set timeout 60
set password "password"
spawn scp -P 10888 emailServer/target/bin/email-server.jar root@shopify_zh:/tmp/
expect {
    "(yes/no)?" {
        send "yes\n"
        exp_continue
    }
    "password:" {
        send "$password\n"
    }
}
interact

发表评论