jinquan26 发表于 2018-8-18 06:44:34

Shell分发系统

#!/usr/bin/expect  
set passwd "123456"               ##建议用密钥,防止口令泄露
  
set host
  
set file
  
spawn rsync -avR --files-from=$file / root@$host:/
  
expect {
  
"yes/no" { send "yes\r"}
  
"password:" { send "$passwd\r" }
  
}
  
expect eof


页: [1]
查看完整版本: Shell分发系统