So I'm home now and tried what I put above and I still have no success.
I didn't say before, but I do have my SSH keys set up with NO password. I can ssh into the remote machine without typing any password, just using keys.
I don't know if this means anything, but I ran my rsync script from a terminal logged in as root (assuming thats what cron kind of does) and I got the following error.
Code:
Permission denied (publickey,keyboard-interactive).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.6]
So I changed my rsync to be really verbose when running (again as root) and this is the output I get
Code:
cmd=ssh machine=***DOMAIN*** user=**USER*** path=///cygdrive/h/Backup/Documents/weekly/
cmd[0]=ssh cmd[1]=-l cmd[2]=**USER*** cmd[3]=***DOMAIN*** cmd[4]=rsync cmd[5]=--server cmd[6]=-vvvvlogDtpre.iLs cmd[7]=--log-format=%i cmd[8]=--delete-after cmd[9]=. cmd[10]=///cygdrive/h/Backup/Dan/Documents/weekly/
opening connection using: ssh -l **USER*** ***DOMAIN*** rsync --server -vvvvlogDtpre.iLs "--log-format=%i" --delete-after . ///cygdrive/h/Backup/Documents/weekly/
note: iconv_open("UTF-8", "UTF-8") succeeded.
_exit_cleanup(code=12, file=io.c, line=600): entered
_exit_cleanup(code=12, file=io.c, line=600): about to call exit(255)
I don't really understand environment variables as well as I probably should. But I did the "env | grep SSH" as suggested and got these variables
Code:
SSH_AGENT_PID=2921
SSH_AUTH_SOCK=/tmp/keyring-uVu2Tn/socket.ssh
So I was wondering. What if I define the SSH_AUTH_SOCK in my script, and that didn't do anything (I assumed I couldn't really define the SSH_AGENT_PID since that probably changes)
Any thoughts on what to do next? I'm sure I just don't fully understand cron. But the script works just GREAT when I run from a terminal as myself as user.
Bookmarks