devkult_
tools29converters34
home/cron/every-30-seconds

Run a Cron Job Every 30 Seconds

Standard cron's smallest unit is the minute, so no expression means 'every 30 seconds'. The usual workaround is two crontab lines for the same job, both on the every-minute schedule below: one runs the job straight away, the other runs sleep 30 first. Together they fire at :00 and :30 of every minute.

* * * * *

In plain English: Every minute.

Field by field

FieldValueMeaning
Minute*every minute
Hour*every hour
Day of month*every day
Month*every month
Day of week*every weekday

Variations

* * * * * /path/to/jobline 1 — runs at :00 of every minute
* * * * * sleep 30; /path/to/jobline 2 — waits 30 seconds, so it runs at :30
* * * * * sleep 15; /path/to/jobadd lines with sleep 15 and sleep 45 as well for every 15 seconds

Tweak any of these in the crontab explainer to see the schedule in plain English and its next run times.

Frequently asked questions

Can cron run every 30 seconds?

Not directly — the minute is the smallest unit in standard cron. Use two entries with a sleep offset, a systemd timer (OnUnitActiveSec=30s with AccuracySec=1s), or a long-running process with its own loop.

Is the sleep trick reliable?

Mostly. The second run starts about 30 seconds in but can drift when the machine is busy, and runs overlap if the job takes longer than 30 seconds. Wrap the command in flock to prevent overlaps; for precise timing, use a systemd timer.

Related schedules

New to cron syntax? Read Cron Expressions Explained, Field by Field. Job not firing? Work through Cron Job Not Running? 10 Things to Check.