Cron Expression: Cron Every Other Day

Learn how to create a cron expression for 'cron every other day'. Runs at midnight on alternating days, with the month-boundary caveat explained.

Cron Expression

0 0 */2 * *

Want to tweak this schedule?

Edit this expression in our interactive generator and see it broken down in real time.

Open in Cron Generator

Expression Breakdown

0
Minute
(0-59)
0
Hour
(0-23)
*/2
Day
(1-31)
*
Month
(1-12)
*
Weekday
(0-6)
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

Cron Expression

0 0 */2 * *

What This Expression Does

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.

The Month-Boundary Caveat

*/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.)

Use Cases

This cron schedule is commonly used for:

How to Use

  1. Copy the cron expression above
  2. Open your crontab with crontab -e
  3. Add a new line with: 0 0 */2 * * /path/to/your/script.sh
  4. Save and exit

Alternative Formats