0
在以下期望腳本中,我注意到腳本甚至在提示輸入密碼之前會發送密碼。這怎麼能被阻止?我可以使用等待語句嗎?在腳本中使用等待
#!/usr/bin/expect -f
#set timeout 25
spawn rsync [email protected]:'/usr/backups /usr/backup-scripts /root/test/' /root/
expect "[email protected]'s password: $"
send "\$xxxxxx\n"
expect "\\$ $
檢查有沒有在環境設置一個RSYNC_PASSWORD?或者是目標服務器中使用的公鑰? (在這種情況下,請刪除密鑰) – ajreal 2010-11-26 07:51:21