通过crontab使用ssh代理在ssh上执行rsync命令
我有一个cronjob: 0 9 * * * rsync -a mydir remote_machine: 我用“ crontab -e”安装了它。我有一个ssh-agent运行,当我执行rsync命令本身时,它没有任何用户交互或密码输入即可工作,但是cronjob失败,并显示以下消息: Date: Wed, 9 Dec 2009 11:11:00 -0600 (CST) From: Cron Daemon <me@my_machine.my_domain> To: me@my_machine.my_domain Subject: Cron <me@my_machine> rsync -a /home/me/mydir remote_machine: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-with-mic,password). rsync: connection unexpectedly …