Cron Expression for Every 4 Hours: 0 */4 * * *

Runs 6 times per day (00:00, 04:00, 08:00, 12:00, 16:00, 20:00). Ideal for: Static site rebuilds, container vulnerability scans, and warehouse sync jobs.

0 */4 * * *
Runs 6 times per day (00:00, 04:00, 08:00, 12:00, 16:00, 20:00)

5-Field Cron Breakdown

0
Minute
At minute 00
*/4
Hour
Every 4th hour (0, 4, 8, 12, 16, 20)
*
Day of Month
Every day
*
Month
Every month
*
Day of Week
Every weekday

Live Next-10-Runs Simulator (UTC & Local Time)

Runs 6 times per day (00:00, 04:00, 08:00, 12:00, 16:00, 20:00)

Run #UTC Execution TimeSelected TimezoneRelative
Calculating next 10 runs locally...

Copy-Paste Snippets Across Platforms

Linux Crontab (Overlap-Safe with flock)

0 */4 * * * /usr/bin/flock -n /tmp/my-job.lock /usr/local/bin/job.sh >> /var/log/my-job.log 2>&1

GitHub Actions Workflow YAML

on:
  schedule:
    - cron: '0 */4 * * *' # UTC only
  workflow_dispatch: {}

Quartz (6-Field) & AWS EventBridge

Quartz 6-field: 0 0 */4 * * ?
AWS EventBridge: cron(0 */4 * * ? *)

Kubernetes CronJob Spec

apiVersion: batch/v1
kind: CronJob
metadata:
  name: scheduled-job
spec:
  schedule: "0 */4 * * *"
  timeZone: "Etc/UTC"
  concurrencyPolicy: Forbid

Production Pitfalls & Best Practices

Key Pitfall: Avoid `* */4 * * *` — forgetting `0` in the minute slot causes 60 executions per 4-hour mark.
Common Use Cases: Static site rebuilds, container vulnerability scans, and warehouse sync jobs.
JetBrains Plugin + Gumroad Kit

Running Scheduled Jobs in Production? Protect Secrets with JetBrains EnvGuard

Catch leaked API keys, database URLs, and broken .env configs inside IntelliJ IDEA / PyCharm before your cron jobs hit production, plus grab our DevOps Automation Kits on Gumroad.

Frequently Asked Questions

What does the cron expression `0 */4 * * *` mean?

`0 */4 * * *` means: Runs 6 times per day (00:00, 04:00, 08:00, 12:00, 16:00, 20:00). Its 5 fields map to Minute=0, Hour=*/4, Day-of-Month=*, Month=*, and Day-of-Week=*.

How do I run `0 */4 * * *` in GitHub Actions?

Add `on: schedule: - cron: '0 */4 * * *'` to your workflow YAML. Remember GitHub Actions always interprets cron schedules in UTC and enforces a minimum 5-minute interval.

What is the Quartz / AWS EventBridge equivalent of `0 */4 * * *`?

In 6-field Quartz cron use `0 0 */4 * * ?` (adding leading seconds `0` and `?` mutual exclusion). In AWS EventBridge use `cron(0 */4 * * ? *)`.

Related Cron Recipes