您的位置:首页 > 运维架构 > Linux

多linux服务器之间实现文件自动复制(脚本)

2010-08-12 08:28 92 查看
#!/usr/bin/expect
set password 1234  #密码
#download
spawn scp /root/test.jar root@192.168.1.2:/usr/local/ 
set timeout 300
expect "192.168.1.2's password:"
set timeout 3000
#exec sleep 1
send "$password\r"
set timeout 300
send "exit\r"
#expect eof
interact
spawn scp /root/test.jar root@192.168.1.3:/usr/local/ set timeout 300
expect "root@192.168.1.3's password:"
set timeout 3000
#exec sleep 1
send "$password\r"
set timeout 300
send "exit\r"
interact 阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: