What is Cron?
Cron is a time-based job scheduler found in Unix-like operating systems. A cron expression is a string of five fields that defines when a scheduled task should run. System administrators and developers use crontab to automate recurring tasks like backups, log rotation, database maintenance, and deployments.
Cron Syntax Reference
| Field | Range | Special Characters |
| Minute | 0-59 | * , - / |
| Hour | 0-23 | * , - / |
| Day of Month | 1-31 | * , - / |
| Month | 1-12 | * , - / |
| Day of Week | 0-6 (Sun=0) | * , - / |
Special Characters
* | Any value (wildcard) |
, | List separator (e.g., 1,3,5) |
- | Range (e.g., 1-5 = Monday to Friday) |
/ | Step (e.g., */5 = every 5 units) |
Examples
0 0 * * * | Every day at midnight |
*/15 * * * * | Every 15 minutes |
0 9 * * 1-5 | Every weekday at 9:00 AM |
0 0 1 * * | First day of every month at midnight |
30 2 * * 0 | Every Sunday at 2:30 AM |