Cron every 2 hours

0 */2 * * *

0 */2 * * * runs a job every two hours, on the hour. The 0 pins the minute, and */2 in the hour field picks every even hour: 0, 2, 4 … 22.

When it fires

At midnight and every even hour after it, whatever the time you installed it. Checked at 09:58 UTC, the next five runs are:

10:00  12:00  14:00  16:00  18:00

For the odd hours instead, give the step a start: 0 1-23/2 * * * runs at 01:00, 03:00 and so on.

A common mistake

* */2 * * * leaves the minute as *, so it runs every minute of every even hour: 60 times, then nothing for an hour. Always set the minute.

Variations

30 */2 * * *         every 2 hours at half past: 00:30, 02:30 …
0 8-20/2 * * 1-5     every 2 hours from 08:00 to 20:00, Monday to Friday
0 */3 * * *          every 3 hours

The same schedule elsewhere

  • GitHub Actions: cron: '0 */2 * * *', in UTC.
  • Kubernetes CronJob: schedule: "0 */2 * * *".
  • AWS EventBridge: rate(2 hours), or cron(0 0/2 * * ? *).
  • systemd timer: OnCalendar=0/2:00.
  • Spring @Scheduled: 0 0 */2 * * *.

Try it in the Cron Builder

On the hour, every 2 hours

Read as a crontab line, where Sunday is 0 or 7.

minutehourday of monthmonthday of week
0*/2***

Next runs

Working out the next runs from your clock…

Runs in your browser. Nothing you enter is sent anywhere.