Cron every 2 days (and the month-end catch)
Every 2 days in cron is 0 0 */2 * *, which restarts each month on the 1st; this page shows the real next runs, calculated in your browser.
0 0 */2 * *
0 0 0 */2 * ?
cron(0 0 1/2 * ? *)
Read by our parser as: At 12:00 AM (midnight), on every 2nd day of the month (the 1st, 3rd, 5th, ...). Open in the cron checker
Next 10 runs
Calculating in your browser...
- 1
- 2
- 3
At a glance
- Accepts
- Nothing to enter - the schedule is preset on the page
- Outputs
- The expression in Unix, Quartz/Spring and AWS form, plus its next 10 run times
- Where it runs
- Entirely in your browser, on your device
- What leaves your device
- Nothing - what you type stays in this tab
- Limits
- Run times use your browser's timezone or UTC; real schedulers can start a run late
- Account
- Not required - there is no sign-up
- Price
- Free, with no watermark and no usage cap
- Made by
- Visrut
What it means
0 0 */2 * * runs at midnight on days 1, 3, 5 ... 29, 31 of each month. That's every other day within a month, but the step restarts on the 1st: a 31-day month runs on the 31st and again on the 1st, one day apart, and so does February in a leap year (the 29th, then the 1st). After a 30-day month or a 28-day February the gap is two days.
When this is the right schedule
Use it when roughly every other day is fine and an occasional back-to-back run does no harm, like refreshing a cache or rotating a non-critical report.
When to pick something else
Look elsewhere when the job must be exactly 48 hours apart. Use a rate-based schedule (rate(2 days) on AWS), or run daily and skip odd days since an epoch in the job.
Things to watch
Steps restart every month
Like every cron step, */2 is evaluated within its field (crontab(5) says so explicitly). For day of month that field resets each month, so the sequence is 1, 3, ... 29, 31, 1, 3.
True every-other-day in a shell
Run daily and check the day count: [ $(( $(date +\%s) / 86400 \% 2 )) -eq 0 ] && your-command alternates exactly, regardless of month length. The % signs must be escaped in a crontab.
Even days instead
0 0 2-30/2 * * runs on the 2nd, 4th ... 30th. February ends on the 28th or 29th, so the run after it is the 2nd: a gap of 2 to 4 days.
Frequently asked questions
Does */2 in the day field run every 48 hours?
No. It matches odd days of the month, so the 31st and the next 1st are both run days.
How do I run every 3 days?
0 0 */3 * * gives days 1, 4, 7 ... 31, with the same month-end restart. For an exact interval use a rate or a day-count check in the job.