Cron expression examples

Cron every 6 months

The cron expression for every 6 months is 0 0 1 */6 *. In words: at 00:00, on day 1 of the month, every 6 months.

What each field means

FieldValueMeaning
Minute0minute 0
Hour0midnight
Day of month1day 1
Month*/6every 6 months
Day of week*any day of the week

Times are in the timezone of whatever runs the schedule: the server's local time for crontab, UTC for GitHub Actions.

Use it

In a crontab, with a FlatLyne ping after the job succeeds:

0 0 1 */6 * /usr/local/bin/job.sh && curl -fsS -m 10 --retry 5 https://api.flatlyne.com/<ping-token>

In a Kubernetes CronJob:

apiVersion: batch/v1
kind: CronJob
spec:
  schedule: "0 0 1 */6 *"
  timeZone: "Etc/UTC"

In a GitHub Actions workflow (always UTC):

on:
  schedule:
    - cron: "0 0 1 */6 *"

Know when it doesn't run

Cron doesn't tell you when a job fails or never starts. Create a FlatLyne check with the schedule 0 0 1 */6 *, add the curl above to your job, and get an email, Slack message or PagerDuty incident when a ping is late. See how to monitor a cron job.

Monitor this schedule

Related schedules

Have a different expression? Paste it into the cron expression tool, or browse all examples.