Tuesday, October 4, 2011

Ubuntu crontab to rsync

I had to schedule a job to back up my home directory on a server. It's quite simple.

As a normal user:

> crontab -e

then create a schedule entry for the backup job every day at 2 am

0 2 * * * /usr/bin/rsync -va --delete /home/me/ /var/me/ >> /tmp/crontab.log

I had to specify the full path /usr/bin/rsync. It didn't run without the full path.

For more details see this link.