---
title: "Cron every 30 seconds: crontab workaround"
url: "https://cronmissed.com/cron/every-30-seconds.md"
canonical_url: "https://cronmissed.com/cron/every-30-seconds"
last_updated: "2026-10-22"
type: "reference"
summary: "Cron cannot run a job every 30 seconds in one line. Two crontab lines, one with sleep 30, can. Here is how, and how to monitor it."
related: ["https://cronmissed.com/cron.md", "https://cronmissed.com/cron/every-90-minutes.md", "https://cronmissed.com/cron/last-day-of-the-month.md", "https://cronmissed.com/cron/first-monday-of-the-month.md", "https://cronmissed.com/tools/cron-explainer.md"]
---

# Cron every 30 seconds: crontab workaround

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

Cron cannot run a job every 30 seconds in one line. Two crontab lines, one with sleep 30, can. Here is how, and how to monitor it.

`* * * * *`: Every minute, every day.

## How do you run a job every 30 seconds with cron?

Cron counts in whole minutes. The first line runs at the start of every minute; the second waits 30 seconds and then runs the same job, so together they run it twice a minute.

```crontab
* * * * * /usr/local/bin/job.sh
* * * * * sleep 30; /usr/local/bin/job.sh
```

## What does * * * * * mean?

| Field | Written | Means |
| --- | --- | --- |
| minute | `*` | every minute |
| hour | `*` | every hour |
| day of month | `*` | every day of month |
| month | `*` | every month |
| day of week | `*` | every day of week |

## How often does it run?

On a day it runs, it runs 1,440 times. It runs on 365 days of 2027, 525,600 runs in all. Runs are 1 minute apart.

## When is this schedule useful?

Near-real-time jobs such as draining a small queue, sending pending notifications, or polling a sensor, on a host where a long-running daemon is not an option.

## What should you watch out for?

If one run takes longer than 30 seconds, runs overlap. Use flock -n, and consider a small service with a loop instead.

## What happens when the clocks change?

On Sunday 14 March 2027, clocks in America/New_York jump from 02:00 to 03:00. The 60 runs from 02:00 to 02:59 fall in the missing hour and do not happen, because cronie schedules jobs that run more than once an hour normally.

On Sunday 1 November 2026, clocks in America/New_York fall back from 02:00 to 01:00, so the hour from 01:00 happens twice. Cronie runs this schedule normally through the repeated hour, so 11 runs happen twice, once at each offset.

A server that keeps its clock on UTC never sees either change.

## How do you get an alert when it stops running?

Create a simple check that expects a ping every 1 minute, with 1 minute of grace, and ping it at the end of the job:

```crontab
* * * * * /usr/local/bin/job.sh && curl -fsS --max-time 10 --retry 5 --retry-connrefused -o /dev/null "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
* * * * * sleep 30; /usr/local/bin/job.sh && curl -fsS --max-time 10 --retry 5 --retry-connrefused -o /dev/null "https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10"
```

The [snippet builder](https://cronmissed.com/tools/snippet-builder.md) writes the same ping for systemd, GitHub Actions, Vercel, Kubernetes and backup scripts.

## More schedules one cron line cannot write schedules

- [Every 90 minutes](https://cronmissed.com/cron/every-90-minutes.md): `0 0-21/3 * * *`
- [Last day of the month](https://cronmissed.com/cron/last-day-of-the-month.md): `0 0 28-31 * *`
- [First Monday of the month](https://cronmissed.com/cron/first-monday-of-the-month.md): `0 9 1-7 * *`
- [Every two weeks](https://cronmissed.com/cron/every-two-weeks.md): `0 9 * * 1`

## Related

- [Cron expression and crontab examples](https://cronmissed.com/cron.md)
- [Cron every 90 minutes: crontab workaround](https://cronmissed.com/cron/every-90-minutes.md)
- [Cron last day of the month: crontab workaround](https://cronmissed.com/cron/last-day-of-the-month.md)
- [Cron first Monday of the month](https://cronmissed.com/cron/first-monday-of-the-month.md)
- [Cron expression translator and evaluator](https://cronmissed.com/tools/cron-explainer.md)
