Page 1 of 1

Cron jobs

Posted: 16 Sep 2010, 23:08
by viking60
Ok I have this long rsync backup that I need to automate so I wanted to make a cronjob out of it:

Code: Select all

sudo EDITOR=nano crontab -e

That will open or create the file.
You can find the syntax here

So I want the backup to start at 11.30 pm so I enter this line (directly under any others you may have):

Code: Select all

30 23 * * * /usr/bin/rsync -av --delete --exclude=/tmp /home/viking /media/win/viking_home_backup


/home/viking is my source and /media/win/ is my USB disk (target) + the backup folder.
In the terminal you would write:

Code: Select all

rsync -av --delete --exclude=/tmp /home/viking /media/win/viking_home_backup

But you need the full path of the program in cron jobs.

I go out with CTRL+O and CTRL+X

To chek your cron jobs you can type crontab -l
I had to write it down ;) So this is a good place for it.