Cron
/ Update
2 min read
Cron is a time-based job scheduler in Unix-like operating systems.
Automating recurring tasks, such as automated file backups, script execution, or application launching post-boot etc. is managed in Linux via the cron system daemon.
- The cron Process: A background service initialized during the system boot sequence that continuously monitors the system time and executes scheduled automation tasks.
- The crontab (Cron Table): A specialized text configuration file containing a structured list of commands scheduled to run at specific time intervals.
The crontab configuration can be edited using the crontab -e command
Crontab Syntax & Time Fields#
A crontab entry requires exactly six fields written sequentially on a single line. The first five fields define the precise time execution criteria, while the sixth field defines the targeted command string.
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12)
| | | | .---- day of week (0 - 6) (Sunday to Saturday)
| | | | |
* * * * * /path/to/command_or_scriptplaintextSyntax Field Descriptions#
| Field | Token | Definition | Valid Range / Operators |
|---|---|---|---|
| 1 | MIN | Minute of the hour | 0 - 59 |
| 2 | HOUR | Hour of the day | 0 - 23 (24-hour format) |
| 3 | DOM | Day of the Month | 1 - 31 |
| 4 | MON | Month of the Year | 1 - 12 |
| 5 | DOW | Day of the Week | 0 - 6 (0 is conventionally Sunday) |
| 6 | CMD | Targeted Command | The actual shell command or script path to execute |
3. Advanced Time Operators & Execution Syntax#
Crontabs support specialized operators to create complex, periodic time frequencies without requiring absolute, explicit static integers.
Wildcards and Step Intervals#
- The Asterisk (*) Wildcard: Acts as a “don’t care” value. When placed in a field, the command evaluates as matching every possible increment within that field’s scope (e.g., an asterisk in the MON field means execution happens every single month).
- The Step Operator (/): Specifies a step increment value across a range. For instance, pairing the wildcard with a step operator in the hour field (*/12) dictates execution strictly every twelve hours.
Cron
https://nahil.xyz/vault/linux/cron/
Author Nahil Rasheed
Published at May 23, 2026
Copyright
CC BY-NC-SA 4.0
Disclaimer This content is provided strictly for educational purposes only.