Launch Workspace
Standard Cron · 5 fields · 6 Times Daily

Cron Every 4 Hours — 0 */4 * * *

Executes six times per 24-hour period on the hour: 00:00, 04:00, 08:00, 12:00, 16:00, and 20:00.

Interval vs Fixed Time

Need to run once a day at 4:00 AM instead of every 4 hours? Use 0 4 * * * (Every Day at 4:00 AM).

Dialect:
5 fields
Plain EnglishHourly Interval

“Every 4 hours, on the hour”

Runs every 4 hours, on the hour. Evaluated according to STANDARD cron specifications.

Popular Presets:

How 0 */4 * * * Works

In a standard five-field Cron expression, 0 */4 * * * breaks down as follows:

  • Minute (0): Exactly at minute 0 (on the hour).
  • Hour (*/4): Every 4 hours starting at hour 0 (matching 0, 4, 8, 12, 16, 20).
  • Day of Month (*): Every day of the month.
  • Month (*): Every month of the year.
  • Day of Week (*): Every day of the week.

Typical production use cases for every-4-hour schedules include incremental database backups, automated log file rotation, synchronizing exchange rates or weather feeds, and warming cache clusters.

Platform Examples for 0 */4 * * *

Ready-to-use snippets for all major platforms and schedulers.

Linux / Crontab5-field POSIX cron
# /etc/cron.d/my-schedule
MAILTO="admin@example.com"
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Runs every 4 hours on the hour
0 */4 * * * www-data /usr/local/bin/my-script.sh >> /var/log/my-script.log 2>&1
Kubernetesbatch/v1 CronJob manifest
apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-scheduled-job
  labels:
    app: my-scheduled-job
spec:
  schedule: "0 */4 * * *"
  timeZone: "UTC"          # requires Kubernetes v1.27+
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: job
            image: alpine:latest
            command:
            - /bin/sh
            - -c
            - echo "Job executed at $(date)"
          restartPolicy: OnFailure
GitHub Actionsworkflow schedule trigger (UTC only)
name: Scheduled Workflow

on:
  schedule:
    # Runs every 4 hours on the hour — evaluated strictly in UTC
    - cron: "0 */4 * * *"
  workflow_dispatch: # allow manual trigger

jobs:
  run-job:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Run task
        run: echo "Workflow triggered at $(date)"
Spring Boot@Scheduled — 6-field cron with seconds
@Component
public class ScheduledTask {

    private static final Logger log = LoggerFactory.getLogger(ScheduledTask.class);

    // Runs every 4 hours on the hour
    // Spring uses 6-field cron: sec min hr dom mon dow
    @Scheduled(cron = "0 0 */4 * * *", zone = "UTC")
    public void runTask() {
        log.info("Scheduled job started at: {}", LocalDateTime.now());
        // your business logic here
    }
}
AWS EventBridge6-field cron with year field
# AWS EventBridge Rule (CloudFormation)
Resources:
  ScheduledRule:
    Type: AWS::Events::Rule
    Properties:
      Name: my-scheduled-rule
      ScheduleExpression: "cron(0 */4 * * ? *)"
      State: ENABLED
      Targets:
        - Arn: !GetAtt MyLambdaFunction.Arn
          Id: LambdaTarget

Common Variations

Related expressions for similar scheduling needs.

ExpressionDescription
0 */4 * * *Every 4 hours on the hour (00:00, 04:00, 08:00, 12:00, 16:00, 20:00)
0 1-23/4 * * *Every 4 hours with 1-hour offset (01:00, 05:00, 09:00, 13:00, 17:00, 21:00)
0 2-23/4 * * *Every 4 hours with 2-hour offset (02:00, 06:00, 10:00, 14:00, 18:00, 22:00)
30 */4 * * *Every 4 hours at 30 minutes past the hour
0 */4 * * 1-5Every 4 hours on weekdays only (Monday–Friday)
0 4 * * *Once daily at 4:00 AM (fixed time, not interval)

Frequently Asked Questions

Everything you need to know about Cron expressions, syntax rules, and platform nuances.

How do I run a Cron job every 4 hours?

Use "0 */4 * * *". The minute field is 0 (on the hour) and the hour field is "*/4" (every 4th hour). This triggers 6 times per day at 00:00 (midnight), 04:00, 08:00, 12:00 (noon), 16:00 (4 PM), and 20:00 (8 PM).

What is the difference between "0 */4 * * *" and "* */4 * * *"?

This is a critical pitfall. "0 */4 * * *" runs once every 4 hours on the hour (6 times daily). "* */4 * * *" has an asterisk in the minute field and will run 60 times during every 4th hour (360 times daily), which can overwhelm your system.

How do I offset the start time (e.g. 1 AM, 5 AM, 9 AM)?

To offset the 4-hour cadence, define a range with a step: "0 1-23/4 * * *" runs at 01:00, 05:00, 09:00, 13:00, 17:00, and 21:00. "0 2-23/4 * * *" runs at 02:00, 06:00, 10:00, 14:00, 18:00, and 22:00.

How do I run a job once daily at 4:00 AM instead of every 4 hours?

To run only once a day at 4:00 AM, use "0 4 * * *". Notice the lack of a slash (/) in the hour field.

How do I configure an every 4-hour Cron schedule in Spring Boot?

Spring Boot uses 6 fields with seconds: @Scheduled(cron = "0 0 */4 * * *", zone = "UTC"). The leading 0 specifies second 0.