⚡
fasttools.me
Run Cron Job Every 2 Hours (0 */2 * * *)
Bi-Hourly Cadence • 12 Executions Daily

Run Cron Job Every 2 Hours (0 */2 * * *)

Schedule tasks running every 2 hours at minute zero (0 */2 * * *). Visual syntax breakdown, next execution timetable, and server best practices.

Direct Answer Definition

To run a cron job every 2 hours in Linux, use the expression 0 */2 * * *. The 0 in the minute position specifies minute zero, and */2 in the hour position triggers at every even hour (00:00, 02:00, 04:00, 06:00, 08:00, 10:00, 12:00, 14:00, 16:00, 18:00, 20:00, 22:00).

POSIX Cron Expression (5-Field)
Valid Syntax
Natural Language Schedule

Every 2 hours, at minute 0

Standard Schedule PresetsClick to load

Interactive 5-Field Workbench

Adjust individual cron segments in real time with instant two-way synchronization.

1. Minute0
0 – 59
2. Hour*/2
0 – 23 (24h)
3. Day of Month*
1 – 31
4. Month*
1 – 12 (Jan – Dec)
Select Month
5. Day of Week*
0 – 6 (Sun – Sat)
Select Day

Next 5 Scheduled Executions

Real-time schedule timetable projected forward from current timestamp.

12026-10-08 10:00:00 UTC
in 57 min
22026-10-08 12:00:00 UTC
in 2h 57m
32026-10-08 14:00:00 UTC
in 4h 57m
42026-10-08 16:00:00 UTC
in 6h 57m
52026-10-08 18:00:00 UTC
in 8h 57m

Crontab Command Snippet

Enter your executable command or script path to generate the full crontab configuration line.

Ready to paste in `crontab -e`0 */2 * * * curl -fsS https://example.com/cron-job
Runs in system timezone or explicit TZ variablePOSIX Spec
Advertisement
Sponsored Developer Space
Cron Field Syntax Mapping

Field-by-Field Breakdown of `0 */2 * * *`

PositionField NameAllowed ValuesValue in `0 */2 * * *`Evaluation Meaning
1Minute0 – 5900 (At minute 0)
2Hour0 – 23*/2*/2 (Every 2nd hour: 0, 2, 4... 22)
3Day of Month1 – 31** (Every day of the month: 1-31)
4Month1 – 12** (Every month: 1-12)
5Day of Week0 – 6 (Sun-Sat)** (Every day of the week: 0-6)
Technical Engineering Analysis

Bi-Hourly Scheduling & Even-Hour Distribution

A bi-hourly schedule (every 2 hours) is ideal for maintenance tasks that require significant compute or database I/O, such as updating sitemaps, vacuuming temporary tables, and syncing remote CRM data.

The expression 0 */2 * * * evaluates only even hours (00:00, 02:00, 04:00, etc.). If you want odd hours (01:00, 03:00, 05:00, etc.), use the range step notation 0 1-23/2 * * *.

Always ensure the minute field is fixed (e.g. 0 or 15). Omitting the minute field and writing * */2 * * * is a disastrous bug that executes the job every minute for an entire hour.

Real-World Server Implementations

Common Production Scenarios for `0 */2 * * *`

Case 01

Dynamic XML Sitemap Re-generation

Regenerates search engine sitemaps and dispatches update pings to Google Search Console for newly published content.

/usr/bin/node /var/www/site/scripts/build_sitemaps.js
Case 02

CRM Contact & Lead Status Synchronization

Pushes converted leads and marketing qualification flags to Salesforce or HubSpot API endpoints.

/usr/bin/python3 /opt/crm/sync_lead_statuses.py
Case 03

Database Read-Replica Consistency Check

Computes checksums on critical transaction rows between master and read-replicas to catch replication drift.

/usr/local/bin/verify_replica_checksums.sh
Operational Traps & Failure Modes

Production Gotchas When Running `0 */2 * * *`

  • The Asterisk Minute Bug: Writing * */2 * * * will run your task 60 times during every even hour! Always lock the minute field (e.g. 0 */2 * * *).
  • Server Reboots: If the server restarts during an execution hour, cron does not backtrack missed runs.
  • Peak Hour Load: Even hours like 12:00 PM and 02:00 PM overlap with daytime traffic. Schedule heavy scripts for odd off-peak hours if possible.

Frequently Asked Questions About `0 */2 * * *`

Why did my * */2 * * * job run 60 times in an hour?

Because you placed an asterisk in the minute field. An asterisk matches all 60 minutes. To run once every 2 hours, lock minute to zero: 0 */2 * * *.

How do I run every 2 hours on odd hours?

Use range step syntax in the hour field: 0 1-23/2 * * * /path/to/script.sh. It will execute at 01:00, 03:00, 05:00... 23:00.

How many times does 0 */2 * * * execute per day?

Exactly 12 times per day (24 hours divided by 2).

Related Cron Schedule Generators