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