Cron Job Every 2 hours

Run a job every two hours on the even hours. Use the cron string 0 */2 * * *, see the next 5 execution times, and copy Python, Node.js, Bash and n8n snippets.

Quick Answers

What does the "Every 2 hours" cron expression mean?
This cron expression is "0 */2 * * *", which in plain English means: Run a job every two hours on the even hours..
When will this cron expression run next?
With the expression "0 */2 * * *", the next execution times are Thu, Aug 06, 2026, 02:00:00 PM UTC, Thu, Aug 06, 2026, 04:00:00 PM UTC, Thu, Aug 06, 2026, 06:00:00 PM UTC.
How do I use this cron expression?
Copy the exact string into crontab, cron triggers, or any scheduler such as GitHub Actions, n8n or Docker. Pre-built code snippets for Python, Node.js, Bash, Docker, GitHub Actions and n8n are included on this page.
Explore the full Cron Cheat Sheet with all 50 schedules
Cron Expression
Copy this exact string into crontab, cron triggers, or schedulers.
0 */2 * * *

Human readable

Run a job every two hours on the even hours.

Next 5 execution times

  1. 1Thu, Aug 06, 2026, 02:00:00 PM UTC
  2. 2Thu, Aug 06, 2026, 04:00:00 PM UTC
  3. 3Thu, Aug 06, 2026, 06:00:00 PM UTC
  4. 4Thu, Aug 06, 2026, 08:00:00 PM UTC
  5. 5Thu, Aug 06, 2026, 10:00:00 PM UTC
Python
from crontab import CronTab
from datetime import datetime

# Install: pip install python-crontab
cron = CronTab(user=True)
job = cron.new(command="/usr/bin/python3 /var/www/job_every-2-hours.py", comment="scheduled by crongen")
job.setall("0 */2 * * *")
cron.write()

print(f"Installed: 0 */2 * * * -> /usr/bin/python3 /var/www/job_every-2-hours.py")

Cron expression FAQ