Skip to content

Cron Every 30 Seconds

Standard cron counts in minutes, so every 30 seconds needs a scheduler with a seconds field, such as Spring or Quartz, or a small trick in crontab.

second · minute · hour · day · month · weekday

Build it with controlsEvery 30 s
Every … seconds

In plain English

Every 30 seconds.

Tap a field to see what it means.

A week20,160 runs
Mon2,880Tue2,880Wed2,880Thu2,880Fri2,880Sat2,880Sun2,880
Next run
—
Usually every
—
Time zone
Yours
Convert to another schedulerQuartz, Spring, AWS, GitHub Actions, Kubernetes
The same schedule in every dialect
Standard cronStandard cron can’t run at a given second: it has no seconds field, so the smallest step is one minute.
Quartz0/30 * * * * ?
Spring*/30 * * * * *current
AWS EventBridgeAWS EventBridge can’t run at a given second: it has no seconds field, so the smallest step is one minute.
GitHub ActionsGitHub Actions can’t run at a given second: it has no seconds field, so the smallest step is one minute.
KubernetesKubernetes can’t run at a given second: it has no seconds field, so the smallest step is one minute.
About SpringTime zone, day numbering, daylight saving
  • Six fields: seconds first. No year. Macros @yearly, @monthly, @weekly, @daily and @hourly work.
  • Day of week follows cron: 0 or 7 is Sunday, 1 is Monday, or MON–SUN.
  • Both day fields must match when both are set. L, W and # are allowed, with a weekday before L (5L, FRIL).
  • Spring doesn’t document what happens in a skipped or repeated hour; the runs here assume skipped and once.

Sources: Spring CronExpression.

How this works: Method, 10 sources, Checked against 1 worked example,

How this works

Method

Linux cron, GitHub Actions and Kubernetes all start at the minute field, so none of them can run a job twice a minute on its own. Spring and Quartz add a seconds field at the front, and there */30 or 0/30 in that field means second 0 and second 30 of every minute. Full method

How it’s tested

One worked example for this page is checked by automated tests before every release: given the inputs, the tool must show the expected answer.

Changes

  • First version: plain English and the next runs for six schedulers, a builder, conversion between them, and 20 pages for common schedules.

How we make toolsReport a mistake

Worked example: */30 * * * * *

Say the clock reads Monday 4 January 2027, 10:07:12 AM UTC. */30 * * * * * means “every 30 seconds”, so the next five runs are Monday 4 January 2027, 10:07:30 AM, 10:08 AM, 10:08:30 AM, 10:09 AM and 10:09:30 AM.

In UTC, where no clock change interrupts it, that comes to 2,880 runs a day, 20,160 a week and 1,051,200 in 2027.

Seconds need a seconds field

Linux cron, GitHub Actions and Kubernetes all start at the minute field, so none of them can run a job twice a minute on its own. Spring and Quartz add a seconds field at the front, and there */30 or 0/30 in that field means second 0 and second 30 of every minute.

Spring writes it */30 * * * * *: six fields, with Spring’s rule that * is fine in both day fields. Quartz writes it 0/30 * * * * ?, because Quartz needs a question mark in one of the two day fields. Both start at second 0 and fire 2,880 times a day.

On a Linux server the usual workaround is two crontab lines: one runs the command at the start of every minute, the other sleeps for 30 seconds first. Together they run every 30 seconds, as long as each run finishes well within half a minute.

* * * * * /path/job.sh
* * * * * sleep 30; /path/job.sh

Pitfalls

  • Pasting */30 * * * * * into a crontab fails: Linux cron counts six fields as five plus a command, and tries to run a program called *.
  • The sleep 30 trick drifts if the machine is busy, and both copies overlap if a run takes more than 30 seconds. A long-running loop or a systemd timer suits sub-minute work better.
  • AWS EventBridge can’t go below a minute: its docs say rates faster than one minute aren’t supported.
  • Spring’s CronExpression has six fields: second, minute, hour, day of month, month and day of week, and its examples include */10 * * * * * for every ten seconds. Source: Spring CronExpression.
  • In Quartz, 0/15 in the seconds field means seconds 0, 15, 30 and 45; a * before the / is the same as starting at 0. Source: Quartz CronExpression.

“Every 30 Seconds” in every scheduler

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.

The same schedule written for each scheduler, converted and checked by this tool. A dash means that scheduler can’t express it in one expression; the note says why.
SchedulerExpressionNote
Standard Unix cron (Vixie cron, cronie)—Standard cron can’t run at a given second: it has no seconds field, so the smallest step is one minute.
Quartz Scheduler (Java)0/30 * * * * ?
Spring Framework @Scheduled*/30 * * * * *
Amazon EventBridge cron()—AWS EventBridge can’t run at a given second: it has no seconds field, so the smallest step is one minute.
GitHub Actions schedule—GitHub Actions can’t run at a given second: it has no seconds field, so the smallest step is one minute.
Kubernetes CronJob—Kubernetes can’t run at a given second: it has no seconds field, so the smallest step is one minute.

Frequently Asked Questions

Can Linux cron run a job every 30 seconds?

Not with one line: its smallest unit is a minute. The common workaround is two lines, * * * * * job and * * * * * sleep 30; job, which start the job at :00 and :30 of every minute.

What is the Spring @Scheduled cron for every 30 seconds?

@Scheduled(cron = "*/30 * * * * *"). Spring reads six fields with seconds first. Spring also has fixedRate = 30000 for a plain interval that doesn’t need cron at all.

Why does Quartz need a question mark here?

Quartz won’t accept values in both the day-of-month and day-of-week fields, so one of them must be ?, meaning “no specific value”. 0/30 * * * * ? puts it in day-of-week.

Can a Kubernetes CronJob run every 30 seconds?

No. Its schedule has five fields, minute first, so once a minute is the most. For anything faster, run a Deployment whose container loops and sleeps.