District news » Websearch-Sync-Index-Cron-News

Websearch-Sync-Index-Cron-News

 

cron is a shell command for scheduling a job (i.e. command or shell script) to run periodically at a fixed time, date, or interval. As scheduled, it is known as a cron job,[1][2][3][4] Although typically used to automate system maintenance and administration it can be used to automate any task. cron is most suitable for scheduling repetitive tasks as scheduling a one-time task can be accomplished via at.

The command name originates from Chronos, the Greek word for time.[5]

The command is generally available on Unix-like operating systems.

 

The actions of cron are driven by a crontab (cron table) file. The crontab files are stored where the lists of jobs and other instructions to the cron daemon are kept. Users can have their own individual crontab files and often there is a system-wide crontab file (usually in /etc or a subdirectory of /etc e.g. /etc/cron.d) that only system administrators can edit.

Each line of a crontab file represents a job, and looks like this:

  * * * * * <command to execute>
# | | | | |
# | | | | day of the week (0–6) (Sunday to Saturday; 
# | | | month (1–12)             7 is also Sunday on some systems)
# | | day of the month (1–31)
# | hour (0–23)
# minute (0–59)

The syntax of each line expects a cron expression made of five fields which represent the time to execute the command, followed by a shell command to execute.