Cron expression generator & parser

Kubernetes CronJob schedule

A Kubernetes CronJob creates a Job on a repeating schedule. The spec.schedule field takes a standard five-field cron expression, plus shortcuts such as @hourly and @daily.

Paste the schedule into the tool below to see what it means and when it runs next.

Cron expression generator & parser
Preset
Show times in
Next runs
Cron expressionCRON

Press Command or Control plus Enter to run. Tab inserts indentation; press Escape, then Tab, to leave the editor.

Result
Your result will appear here.
Ready1 line · 9 chars

Example CronJob

Runs at 02:00 in the given time zone, never runs two copies at once, and keeps a short history:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: nightly-report
spec:
  schedule: "0 2 * * *"
  timeZone: "Europe/Berlin"
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 300
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: report
              image: busybox:1.36
              command: ["sh", "-c", "date; echo running report"]

Fields that matter for scheduling

FieldWhat it does
scheduleThe cron expression. Without timeZone, it uses the time zone of the kube-controller-manager, which is usually UTC.
timeZoneAn IANA name such as Europe/Berlin or America/New_York. Stable since Kubernetes 1.27. Don't put CRON_TZ= or TZ= in schedule; it isn't supported.
concurrencyPolicyAllow (default) lets runs overlap, Forbid skips a run while the last one is still going, Replace stops the old run and starts the new one.
startingDeadlineSecondsHow late a run may start before it counts as missed, for example after the controller was down.
suspendSet to true to pause the schedule without deleting the CronJob.

Test a CronJob without waiting

Create a one-off Job from the CronJob's template, then follow its logs:

kubectl create job --from=cronjob/nightly-report nightly-report-manual
kubectl logs -f job/nightly-report-manual

Frequently asked questions

Why does my CronJob say "too many missed start times"?

If more than 100 scheduled runs were missed, for example because the CronJob was suspended or the controller was down, Kubernetes stops trying to start them. Set startingDeadlineSeconds so only recent missed runs are counted.

What time zone does a Kubernetes CronJob use?

The time zone of the kube-controller-manager unless you set spec.timeZone. On managed clusters this is normally UTC.

Can a CronJob run every 30 seconds?

No. The smallest unit in the schedule is one minute. For shorter intervals, run a Deployment whose container loops with a sleep.

More cron expression generator & parser guides

Open the full cron expression generator & parser →

From the blog