# Run a Cron Job Every 30 Seconds

> Cron can't schedule anything more often than once a minute. Two ways to run a job every 30 seconds anyway — a sleep offset or a systemd timer — and their caveats.

```
* * * * *
```

In plain English: Every minute.

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.

## Field by field

| Field | Value | Meaning |
|---|---|---|
| Minute | `*` | every minute |
| Hour | `*` | every hour |
| Day of month | `*` | every day |
| Month | `*` | every month |
| Day of week | `*` | every weekday |

## Variations

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

## FAQ

### 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

- [* * * * * — Run a Cron Job Every Minute](https://www.devkult.com/cron/every-minute.md)
- [*/2 * * * * — Run a Cron Job Every 2 Minutes](https://www.devkult.com/cron/every-2-minutes.md)
- [*/5 * * * * — Run a Cron Job Every 5 Minutes](https://www.devkult.com/cron/every-5-minutes.md)

Open the interactive page: https://www.devkult.com/cron/every-30-seconds