Test your cron expression
Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule. On Linux you can run crontab -e to edit it.
Format
┌───────────── minute (0 - 59) │ ┌───────────── hour (0 - 23) │ │ ┌───────────── day of month (1 - 31) │ │ │ ┌───────────── month (1 - 12) │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday) │ │ │ │ │ * * * * * command to execute
Each line has a cron expression made of five fields, followed by a shell command to execute.
Examples
| Expression | Description |
|---|---|
| */5 * * * * | Every 5 minutes |
| 0 */8 * * * | Every 8 hours |
| 1,5 * * * * | Minutes 1 and 5 of each hour |
| 1-5 * * * * | Minutes 1, 2, 3, 4 and 5 of each hour |
| 0 2 * * * | Once a day at 2 am |
| 0 1 * * 1,2 | Monday and Tuesday at 1 am |
| 0 0 * * 1 | Every Monday at midnight |
| 0 0 1 * * | Day 1 of each month at midnight |
| 0 0 */5 * * | Every 5 days |