Regex and cron

Cron Expression for Every 30 Seconds

At second 0 and second 30 of every minute, using the 6-field syntax with a leading seconds field. Copy it, check the next runs in your time zone and grab a snippet for your platform.

  • Free foreverNo trial, no paywall, no usage limits.
  • No sign-upOpen the page and start. We never ask for an email to use a tool.
  • PrivateEverything runs in your browser. Your input is never uploaded or stored on our servers.
  • Works offlineOnce the page has loaded, the tool keeps working without a connection.

Cron expression

*/30 * * * * *
Customize
*/30secondSecond: every 30 seconds: :00 and :30*minuteMinute: every minute*hourHour: every hour*day (month)Day of month: every day of the month*monthMonth: every month*day (week)Day of week: every day of the week

At second 0 and second 30 of every minute, using the 6-field syntax with a leading seconds field.

Time zone
Run times, the week view and the snippets use this zone. It starts as your device's zone.
Show times as 9:00 AM instead of 09:00.

Next runs

Each run in your selected time zone, with the same moment in UTC. Daylight saving changes follow cronie, the cron on most Linux servers.
Copy run times (ISO 8601)

Next 7 days

Each square is one hour of local time in your selected zone. Darker squares have more runs. Daylight saving changes are not drawn.

Use it on your platform

Copy-ready config for each scheduler. Dialects differ: some only run in UTC, some can't do seconds, Cloudflare and AWS number weekdays from 1 = Sunday. The snippet handles the conversion and says what changed.
A line for crontab -e on Linux or macOS (Vixie cron, cronie).on.schedule for a workflow, with the timezone field GitHub added in March 2026 (UTC when omitted).A CronJob manifest with the timeZone field (Kubernetes 1.27+).Cron Triggers in wrangler.toml for a Worker. Runs in UTC and numbers weekdays from 1 = Sunday.crons in vercel.json plus the route it calls. Runs in UTC.EventBridge Scheduler (any time zone, recommended by AWS) and a legacy EventBridge scheduled rule (UTC).A .timer unit with OnCalendar=, the systemd replacement for cron.
Works with a caveatRuns in your time zone
crontab -e
Copy crontab -eDownload my-job.crontab
# ┌───────────── minute (0–59)
# │ ┌─────────── hour (0–23)
# │ │ ┌───────── day of month (1–31)
# │ │ │ ┌─────── month (1–12)
# │ │ │ │ ┌───── day of week (0–6, Sunday = 0)
# │ │ │ │ │
# * * * * *  command
CRON_TZ=UTC
* * * * *  /path/to/my-job.sh >> /var/log/my-job.log 2>&1
* * * * *  sleep 30; /path/to/my-job.sh >> /var/log/my-job.log 2>&1
  • Cron's smallest unit is one minute, so each line starts at the top of the minute and sleeps first. Expect a little drift, and add flock -n if runs can overlap.
  • CRON_TZ=UTC is honored by cronie (Fedora, RHEL, Arch). Other cron daemons ignore it and use the server's time zone, so check timedatectl first.
  • Edit with crontab -e. Cron starts the next run even if the last one is still going; wrap the command in flock -n /tmp/my-job.lock to prevent overlaps.

Need scheduled jobs, queues and monitoring that never miss a run? Talk to our team

Quick answer

The 6-field cron expression for every 30 seconds is */30 * * * * *, where the first field is seconds, so it fires at second 0 and second 30 of every minute. Spring and node-cron accept it directly; Quartz needs a question mark in one day field, as */30 * * * * ?. Standard crontab cannot: its smallest unit is one minute, so you run two lines, one of them prefixed with sleep 30, or use a systemd timer.

  • Live next runs
  • Any time zone
  • Field-by-field breakdown
  • Seven platform snippets
  • Daylight saving aware

How to use this schedule

  1. 1Copy */30 * * * * * with the Copy expression button.
  2. 2Check Next runs in your time zone to confirm it fires when you expect, including around daylight saving changes.
  3. 3Pick your platform under Use it on your platform and copy the ready-made crontab line, workflow, manifest or timer.
  4. 4Need a different time or day? Click Customize to open it in the cron expression generator and change any field.

Why can't standard cron run every 30 seconds?

Classic crontab has five fields and the first one is the minute. The daemon wakes once a minute, checks which entries match the current minute and starts them. There is no seconds field, so nothing finer than one minute can be expressed.

*/30 * * * * * comes from the 6-field dialect used by Spring's @Scheduled(cron = …) and node-cron. They add a seconds field at the front, and */30 in that slot means seconds 0 and 30. Spring requires all six fields and node-cron makes seconds optional. Quartz also puts seconds first but rejects this exact string: one day field must be ?, so there it is */30 * * * * ?. Count the fields before you deploy: the same characters mean very different things in the two dialects.

ExpressionFieldsRuns
*/30 * * * * *6, seconds firstEvery 30 seconds
*/30 * * * *5, minute firstEvery 30 minutes

If you paste the 6-field version into crontab -e, nothing warns you. Cron reads the first five fields as an every-30-minutes schedule and hands the final * to the shell as the command, which expands to the file names in the home directory.

How do I run a job every 30 seconds on Linux?

You have three good options, depending on how exact the timing needs to be:

  1. Two crontab lines. Both fire every minute; the second waits 30 seconds first.
  2. A systemd timer with OnCalendar=*:*:0/30 and AccuracySec=1s. The default accuracy is one minute, which would blur a 30-second rhythm, so lowering it matters.
  3. A long-running worker that loops and sleeps. Best when the work is really continuous, such as polling a queue.
* * * * * /path/to/job
* * * * * sleep 30; /path/to/job

The sleep trick is approximate: sleep 30 starts counting when cron launches the line, a moment after the minute begins, so the second run lands slightly after :30. Over a day that is 2,880 runs, and if any run takes longer than 30 seconds the two lines overlap. Guard both with the same lock file. If you only need near-real-time rather than exactly 30 seconds, every minute is simpler and fully portable.

What does each field in */30 * * * * * mean?

FieldValueAllowedMeaning
Second*/300–59every 30 seconds: :00 and :30
Minute*0–59every minute
Hour*0–23every hour
Day of month*1–31every day of the month
Month*1–12, JAN–DECevery month
Day of week*0–7 (0 and 7 are Sunday), SUN–SATevery day of the week

Read together: At second 0 and second 30 of every minute, using the 6-field syntax with a leading seconds field.

How do I adjust */30 * * * * * to my own schedule?

Small edits to */30 * * * * * cover most real-world needs:

ExpressionWhat it does
*/15 * * * * *Every 15 seconds, in 6-field syntax
0,30 * * * * *The same schedule written as a list: second 0 and second 30
15,45 * * * * *Every 30 seconds, offset to :15 and :45 of each minute
*/30 * 9-17 * * 1-5Every 30 seconds during business hours, Monday to Friday (6-field)
* * * * *Every minute, the closest standard crontab gets

Need something else? Click Customize at the top of the page to open this schedule in the cron expression generator and change any field.

Related schedules: Every minute · Every 2 minutes · Every 5 minutes · Every 30 minutes

Browse all schedules in the cron schedule library.

How do I run */30 * * * * * in crontab, GitHub Actions, Kubernetes and the cloud?

PlatformWrite it asTime zone
Linux crontabTwo lines with sleep (see below)Server's time zone; CRON_TZ= in cronie
GitHub ActionsNot supported (1-minute minimum)UTC by default; add timezone: (IANA name). Runs at most every 5 minutes
Kubernetes CronJobNot supported (1-minute minimum)Set timeZone: (1.27+)
Cloudflare WorkersNot supported (1-minute minimum)UTC only; numbers weekdays from 1 = Sunday, so use names
Vercel Cron JobsNot supported (1-minute minimum)UTC only; more than once a day needs Pro (Hobby: once a day)
AWS EventBridge SchedulerNot supported (1-minute minimum)Takes a time zone; legacy scheduled rules are UTC only
systemd timerOnCalendar=*-*-* *:*:00,30Add a zone after the time, e.g. Europe/London

In a crontab (crontab -e), the full line looks like this:

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

The live panel at the top of the page builds complete, copy-ready files for each platform (workflow, CronJob manifest, wrangler.toml, vercel.json, AWS CLI and systemd units) and can shift the schedule to UTC for platforms that need it.

What can go wrong with */30 * * * * *?

  • Pasting */30 * * * * * into a regular crontab doesn't fail loudly: cron reads the first five fields as every 30 minutes and treats the last * as the command.
  • The sleep 30 trick is two independent jobs. If a run takes longer than 30 seconds they overlap, so put both lines behind the same lock: flock -n /tmp/job.lock /path/to/job.
  • systemd timers default to AccuracySec=1min, which lets runs drift anywhere within a minute. Set AccuracySec=1s or the 30-second rhythm disappears.
  • GitHub Actions, Kubernetes CronJobs, Cloudflare Cron Triggers and Vercel have no seconds field, and AWS EventBridge stops at one minute. For sub-minute work there, run a long-lived worker that sleeps 30 seconds between iterations.
  • At 2,880 runs a day, a log line per run adds up quickly. Log failures only, or rotate the log file.
  • In a zone with daylight saving time, a schedule with * in the minute or hour field follows the wall clock: the spring-forward night loses an hour of runs and the fall-back night repeats one. Servers on UTC never see this.

Frequently asked questions

Not directly. Crontab's smallest unit is one minute. The usual workaround is two entries that both run every minute, with the second one starting with sleep 30, which gives runs at roughly second 0 and second 30.
The 6-field version has a leading seconds field and fires at second 0 and 30 of every minute. The 5-field version starts with the minute field and fires at minute 0 and 30 of every hour, which is every 30 minutes.
Yes. Spring cron expressions have six fields with seconds first, so a cron of */30 * * * * * runs every 30 seconds. For a plain interval that does not need to line up with the clock, fixedRate = 30000 is an alternative.
Yes. A timer with OnCalendar=*:*:0/30 and AccuracySec=1s schedules every run against the clock, while the sleep trick counts 30 seconds from whenever cron happened to start the second line.

Last updated by the Playxoft engineering team.

From the engineers who built this tool

Need scheduled jobs that never miss a run?

Cron is the easy part. Retries, overlapping runs, time zones, queues and alerts when a job silently stops are where schedules break. We build background job systems you can trust, and we will review your setup for free.

More free tools

See all tools

Regex Tester

Test regex live with highlighted matches, plain-English explanations and code export.

Open tool

Cron Expression Generator

New

Build and explain cron schedules, see the next runs in any time zone, copy platform snippets.

Open tool

SQL Formatter

Beautify or minify SQL in 12 dialects, with keyword case, indent and line:column errors.

Open tool

cURL to Python Converter

New

Convert cURL commands into Python requests or httpx code with params, json, files and auth.

Open tool

cURL to Fetch Converter

New

Turn any cURL command into JavaScript fetch() code with headers, JSON, forms and auth.

Open tool

cURL to Axios Converter

New

Convert cURL commands into an Axios request config with params, data, auth and timeouts.

Open tool