Setting up cron jobs
November 4th, 2008
Need to setup a script to run at a specified time every day, week or month. Use cron!
While logged into linux you can view your crontab file by typing the following
$crontab -l
# m h dom mon dow command
35 15 * * * python /home/jesterj/fogbugz_sql_backup.py
Notice the time parameters followed by the system command. The format is follows…
#min | hour | day month | month | day of week
10 12 * * * <command here>
The above script would execute at 12:10pm every day.
To edit this file issue the command with an -e option
$crontab -e
To run a command with sudo priviledges, simply issue a ’sudo’ before the cron command like so.
$sudo crontab -e
That’s it!