I'm having troubles getting an rsync script to work on cron. I know this is a question that's been asked aplenty, but I've read all the answers I can find, and followed all of the instructions, but nothing seems to work for me; I'm probably missing something simple.
I have a script that more or less does this:
/usr/bin/rsync -av -e "/usr/bin/ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_dsa" /data/ email@example.com:/backup/last/data/
The script works just fine when I run it manually from ssh as root (key authentication works as expected, and it does not ask for a password), but doesn't seem to want to connect when running through cron as root.
The error log is filled with:
Permission denied, please try again. Permission denied (publickey,password). rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]