I am trying to use rsync in a cron job but looks like cron is not running. Here is the setup:
Host = host.xxx.xxx
Dest = dest.xxx.xxx
The folder to copy from host is /home/mine and it should copy (rsync) to /home/mine in destination machine.
Since I like to use ssh for this and didn’t want password question to pop up (because it should be in cron job), I followed instructions in the following instruction.
• Generate a public key with ssh-keygen as the user that you will be connecting with rsync. Choose a good pass phrase.
• Insert the key you just created into ~/.ssh/authorized_keys.
• Copy the ~/.ssh/authorized_keys file to the other machine(s).
• Set permissions (chmod 644) for ~/.ssh/authorized_keys, if needed.
Then I tried manually the following command in host machine and it works.
rsync -avz -e ssh /home/mine firstname.lastname@example.org
Then in host (host.xxx.xxx) I did crontab –e and entered the following:
0 11 * * * rsync -avz -e ssh /home/mine email@example.com
I was hoping that at 11 AM it would run, but it didn’t. What am I doing wrong? Could someone please help?