Easy. Use the following cron:
0 */2 * * * /home/username/script.shThe 0 at the beginning means to run at the 0th minute.
0 */2 * * * fires at 00:00, 02:00, 04:00, 06:00 …, 22:00 — twelve times a day. The minute field 0 pins the schedule to the top of the hour; the hour step */2 selects every even hour. If you need it pinned to odd hours instead (01:00, 03:00, …), use 0 1-23/2 * * *.
Be aware that */2 does not mean “every two hours starting from when the daemon last fired” — cron is schedule-driven, not interval-driven. If the host was offline at04:00, cron does not catch up at 04:30 when it comes back; the next run is at 06:00. For at-least-once semantics, wrap your script in a state file check or use a job runner that supports retries (Kubernetes CronJobs with startingDeadlineSeconds, AWS EventBridge dead-letter queues, etc.).
For other every-N-hour patterns, see cron every hour and the dedicated guide on cron every day for the daily-at-N-hour case.
Read the dedicated guide: Cron every hour.
View future cron matches in a calendar
Showing next 1000 cron schedules
See this cron expression on the calendar → view example
Other answers and worked examples for the most confusing cron expressions.
Ready to schedule it?
WordPress, Shopify, Railway, Cloud Run, Vercel, HubSpot, Ghost, your own box. If it answers HTTP, Crontap can drive it on a clock you can read, in the timezone that actually matters, and page you when something breaks.
Free forever tier ・ No credit card required
Schedule
“every 5 minutes”
Next run
in 23s
Permalink: https://tool.crontap.com/help/cron-job-expression-every-number-of-hours