Cron Atlas

Cron expression for every 30 seconds

0/30 * * * * ?
secondevery 30
minuteevery minute
hourevery hour
day of monthevery day
monthevery month
day of weekno value

Every 30 seconds.

Next 10 runs

In Quartz, worked out in your browser from the current time.

At a glance

Runs
2,880 a day
Gap between runs
Always 30 seconds
Expressible in
Quartz and Azure; workarounds for the rest
Clock changes
Affected in New York, London, Berlin, Helsinki, Sydney

Open in the tester

In each dialect

Every expression here is generated by the tester’s own engine and checked run for run against the others, so “Exact” means the same clock times in the same zone. Each one links to the tester.

Can’t be written in Cron

Standard cron has no seconds field. Runs 2 times a minute cannot be expressed. The nearest is once a minute.

Workaround

Cron’s finest step is one minute. Two lines that start the same command, one after a 30-second sleep, give a run every 30 seconds.

* * * * * /path/to/command
* * * * * sleep 30; /path/to/command
No equivalent
Can’t be written in EventBridge

AWS EventBridge has no seconds field. Runs 2 times a minute cannot be expressed. The nearest is once a minute.

Workaround

Once a minute is EventBridge’s finest schedule, and rates under a minute are not supported. Either expression here gives one run a minute; for 30-second work, have the target do two passes 30 seconds apart.

aws events put-rule --name every-30-seconds --schedule-expression "rate(1 minute)"
No equivalent
CronScheduleBuilder.cronSchedule("0/30 * * * * ?")
  • The first field is seconds: 0/30. Day of week is ? because day of month already holds *, and a * in both is rejected. The optional year is left off.
Exact
Can’t be written in Kubernetes

Kubernetes CronJob has no seconds field. Runs 2 times a minute cannot be expressed. The nearest is once a minute.

Workaround

A CronJob cannot start Jobs more than once a minute, and a new Pod every 30 seconds is heavy anyway. Run the work in a Deployment whose container loops. Sleeping after each run makes the gap 30 seconds plus the run time.

command: ["sh", "-c", "while true; do /app/job; sleep 30; done"]
No equivalent
Can’t be written in GitHub

GitHub Actions has no seconds field. Runs 2 times a minute cannot be expressed. The nearest is once a minute.

Workaround

There is no way round this on GitHub. The shortest interval is once every 5 minutes, and scheduled runs can start late. Run this work on another scheduler.

No equivalent
[TimerTrigger("0,30 * * * * *")]
  • Six fields with seconds first: 0,30 is the seconds field.
Exact

About this schedule

Only Quartz and Azure put seconds in the expression, so only they can say this directly: seconds 0 and 30 of every minute. Everywhere else the floor is once a minute, and the usual workaround is a second job that waits 30 seconds before starting.

Clock changes

Worked out by running each dialect’s engine through New York’s clock changes; it is affected in London, Berlin, Helsinki, Sydney too, at their own local hours.

DialectClocks go forward (02:00 becomes 03:00)Clocks go back (02:00 becomes 01:00)
CronNo expressionNo expression
EventBridge SchedulerNo expressionNo expression
QuartzThe 120 runs in the missing hour don’t happenRuns once through the repeated hour
KubernetesNo expressionNo expression
GitHubNo expressionNo expression
AzureThe 120 runs in the missing hour don’t happenRuns through both passes of the repeated hour: 120 extra runs

Quartz is exact for 2.5.2.

Questions

What is the cron expression for every 30 seconds?
It is 0/30 * * * * ? in Quartz and 0,30 * * * * * in Azure. Standard cron, EventBridge, Kubernetes and GitHub Actions cannot express it in one line, so this page gives a tested workaround for each.
What happens to this schedule when the clocks change?
It depends on the scheduler. When clocks go forward in New York (02:00 becomes 03:00): Quartz and Azure: the 120 runs in the missing hour don’t happen. The table on this page also covers the autumn change.
Can a Kubernetes CronJob run every 30 seconds?
Not with the schedule alone. A CronJob cannot start Jobs more than once a minute, and a new Pod every 30 seconds is heavy anyway. Run the work in a Deployment whose container loops. Sleeping after each run makes the gap 30 seconds plus the run time.

More schedules