Skip to content

Every 2 Hours

Runs the job every 2 hours at the top of even-numbered hours (00:00, 02:00, 04:00, ..., 22:00). The 0 in the minute field ensures it runs at the start of the hour, and */2 in the hour field creates the 2-hour interval. This is useful for moderate-frequency tasks that do not need hourly execution.

Cron Expression 0 */2 * * *

What is the cron expression for Every 2 Hours?

The cron expression for Every 2 Hours is 0 */2 * * *. This five-field cron schedule uses the format minute, hour, day-of-month, month, and day-of-week. Runs the job every 2 hours at the top of even-numbered hours (00:00, 02:00, 04:00, ..., 22:00). The 0 in the minute field ensures it runs at the start of the hour, and */2 in the hour field creates the 2-hour interval. This is useful for moderate-frequency tasks that do not need hourly execution. Common use cases include database optimization and cdn cache purge.

Field Breakdown

Field Value Meaning
Minute 0 At minute 0
Hour */2 Every 2nd hour (0, 2, 4, 6, ...)
Day of Month * Every day
Month * Every month
Day of Week * Every day of the week

Example Next Run Times

  1. 1. 2026-04-05 14:00
  2. 2. 2026-04-05 16:00
  3. 3. 2026-04-05 18:00
  4. 4. 2026-04-05 20:00
  5. 5. 2026-04-05 22:00

Common Use Cases

Frequently Asked Questions

Does */2 run at even or odd hours?

*/2 starts from 0 and steps by 2, so it runs at 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22 — always even hours. For odd hours, use 1,3,5,7,9,11,13,15,17,19,21,23.

How many times does this run per day?

It runs 12 times per day — once every 2 hours.

Can I start the 2-hour cycle at a specific hour?

The */2 syntax always starts from 0. To start at hour 1, use 1,3,5,7,9,11,13,15,17,19,21,23 as an explicit list.

Related Cron Expressions

0 * * * * Every Hour 0 */6 * * * Every 6 Hours 0 */12 * * * Every 12 Hours

Related Reading

Cron Expression Guide: Syntax, Examples & Common Schedules → How to Generate UUID v4 in JavaScript →