Cron jobs

Cron jobs are an important part of the system, without which you cannot have things execute automatically. Following are some commands which can be used on a shell prompt.

List the cron jobs
crontab -l

Add the crontab
crontab -e

Delete your current cron jobs.
crontab -r

Add or Edit your current cron jobs by using your default text editor
crontab -e will allow you to

Edit con jobs of specific users
crontab -e -u username

Syntax for the numbers:
32 * * * * : will be run every hour on the 32nd minute.
12,42 * * * * : will be run twice an hour on the 12th and 42nd minutes.
*/15 */2 * * *: will be run at 0:00, 0:15, 0:30, 0:45, 2:00, 2:15, 2:30, …
43 18 * * 7: will be run at 6:43pm every Sunday.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s