Cron

From Leo's Notes
Revision as of 04:26, 24 February 2017 by Leo (talk | contribs) (Text replacement - "{{Highlight" to "{{highlight")
This page was last edited on 24 February 2017, at 04:26.

Cron is a program that runs scheduled tasks on Unix based systems. On Linux, the implementation is based on the new Vixie Cron code base.

Basic Usage

The basic usage is to create a crontab file containing the following fields:

# Example of job definition:
# .---------------- minute (0 - 59)
#

Cronjobs can be added by modifing any of the files below:

/etc/crontab
/var/spool/cron/
/etc/crond.d/*
/etc/anacrontab

Common Times

Instead of defining the specific minute, hour, and date for a recurring task, you can use shorthand keywords:

@daily = 0 0 * * *

Notes

Defining both a day of month range and day of week value will cause the job to run when any of the two conditions are met.