Cron Expression
0 0 1 1,7 *
Learn how to create a cron expression for 'cron every 6 months'. Runs January 1st and July 1st at midnight with our free generator tool.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0 | At hour 0 |
| Day of Month | 1 | Day 1 |
| Month | 1,7 | Months 1,7 |
| Day of Week | * | Any day of the week |
This cron expression represents: cron every 6 months
0 0 1 1,7 *
Runs twice per year: at midnight on January 1st and July 1st. The 1,7 list in the month field selects January and July, and the 1 in the day-of-month field pins the run to the first of each.
Semi-annual jobs tend to be housekeeping with a long horizon:
crontab -e
0 0 1 1,7 * /path/to/your/script.sh
*/6 in the Month Field?0 0 1 */6 * looks like “every 6 months” but the step starts at month 1, selecting January and July — the same as 1,7, so it happens to work. The list form is preferred because it’s explicit: change it to 4,10 and you instantly have an April/October cycle, no step arithmetic required.
0 0 1 3,9 * runs March 1st and September 1st0 0 15 1,7 * runs January 15th and July 15th0 0 1 1,7 * /path/to/script.sh || mail -s "Semi-annual job failed" admin@example.com