北航游戏网:本站主要提供海量正版软件本地纯净,安全,无捆绑软件下载服务,热门软件和游戏应有尽有,每天更新大量精品手游及绿色软件!
网站地图
你的位置: 首页 > 游戏资讯 > 操作系统

多linux服务器之间实现文件自动复制

  • 2024-09-26 06:25:54
  • 来源:本站整理
  • 在手机上看

    扫一扫立即进入手机端

  #!/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

手机游戏排行榜