Cron jobs

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Cron jobs

Postby viking60 » 16 Sep 2010, 23:08

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.
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

Return to “Tips & Tricks”