Cron Schedule Reference
Understand how to schedule jobs on Unix-like systems. The syntax determines when the cron daemon will execute the command.
The Syntax
Five fields separated by space:
* * * * *
│ │ │ │ │
│ │ │ │ └─── Day of Week (0 - 6) (0 to 6 are Sunday to Saturday, or use names)
│ │ │ └───── Month (1 - 12)
│ │ └─────── Day of Month (1 - 31)
│ └───────── Hour (0 - 23)
└─────────── Minute (0 - 59)Common Examples
| Key / Code | Description |
|---|---|
| * * * * * | Every minute |
| 0 * * * * | Every hour (at minute 0) |
| 0 0 * * * | Every day at midnight |
| 0 9 * * 1 | Every Monday at 9:00 AM |
| */15 * * * * | Every 15 minutes |
| 0 0 1,15 * * | At midnight on the 1st and 15th of every month |
Special Strings
| Key / Code | Description |
|---|---|
| @reboot | Run once, at startup |
| @daily | Run once a day (0 0 * * *) |
| @learning | Run once a week (0 0 * * 0) |
| @monthly | Run once a month (0 0 1 * *) |
Knowledge is power.