Cron

Cron is a job-scheduling system utility on Unix and Unix-like operating systems. Users can schedule tasks, known as "cron jobs," to run automatically at set intervals. Most Unix users schedule cron jobs to carry out system maintenance tasks, like deleting log files and creating backups, but a user can schedule any command or script they find useful.

A user can schedule a cron job by creating a "crontab" file. A crontab file, or "cron table," specifies the command that will run and when to run it. A crontab file can contain a single cron job or multiple cron jobs. Each entry in a crontab has five variable fields that represent when to run the command, as well as one to specify the command itself:

1 2 3 4 5
* * * * * <command to run>

  1. The minute (0-59)
  2. The hour (0-23)
  3. The day of the month (1-31)
  4. The month (1-12)
  5. The day of the week (0-6, Sunday to Saturday)

Leaving an asterisk in place of a number runs the cron job at every instance of that variable. This allows the user to easily set a cron job to run every set number of minutes, hours, days, or months as necessary. Leaving every asterisk in place will run the cron job every minute.

For example, the following cron job will echo the phrase "hello world" at 3:30 AM on the first day of every month:

30 3 1 * * echo hello world

Updated November 14, 2022 by Brian P.

quizTest Your Knowledge

macOS Sierra followed which version of Apple's operating system?

A
El Capitan
0%
B
Yosemite
0%
C
Mavericks
0%
D
Mountain Lion
0%
Correct! Incorrect!     View the Sierra definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Cron on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.