Learn how to create a cron expression for 'cron every other day'. Runs at midnight on alternating days, with the month-boundary caveat explained.
0 0 */2 * *
Edit this expression in our interactive generator and see it broken down in real time.
| Field | Value | Meaning |
|---|---|---|
| Minute | 0 | At minute 0 |
| Hour | 0 | At hour 0 |
| Day of Month | */2 | Every 2 days of the month |
| Month | * | Any month |
| Day of Week | * | Any day of the week |
This cron expression represents: cron every other day
0 0 */2 * *
Runs at midnight on every odd-numbered day of the month — the 1st, 3rd, 5th, and so on. The */2 step in the day-of-month field starts counting from day 1, so it selects days 1, 3, 5, …, 29, 31.
*/2 resets every month, so it is not strict “every 48 hours.” After a 31-day month, the job fires on the 31st and then again on the 1st of the next month — two consecutive days. February in a leap year does the opposite (runs on the 29th, then a one-day gap to the 1st). For most maintenance jobs this once-a-month wobble is harmless.
If exact alternation matters, run daily and let a date check decide:
0 0 * * * [ $(( $(date +\%s) / 86400 \% 2 )) -eq 0 ] && /path/to/script.sh
This runs the script only on even days since the Unix epoch, giving a true every-second-day rhythm across month boundaries. (The % signs are escaped because % is special in crontab lines.)
This cron schedule is commonly used for:
crontab -e
0 0 */2 * * /path/to/your/script.sh
0 6 */2 * *
0 0 1-31/2 * * (same behavior as */2)0 0 2-30/2 * *