---
title: "Run a cron job every 30 seconds"
url: "https://cronmissed.com/learn/cron-every-30-seconds.md"
canonical_url: "https://cronmissed.com/learn/cron-every-30-seconds"
last_updated: "2026-10-22"
type: "conceptual"
summary: "Unix cron cannot run faster than once a minute. Use two lines with sleep, a systemd timer or an in-process scheduler, and monitor the result."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/cron/every-30-seconds.md", "https://cronmissed.com/cron/every-minute.md", "https://cronmissed.com/guides/supabase-pg-cron.md", "https://cronmissed.com/guides/node-cron.md"]
---

# Run a cron job every 30 seconds

> **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.

Unix cron cannot run faster than once a minute. Use two lines with sleep, a systemd timer or an in-process scheduler, and monitor the result.

The smallest unit in a Unix cron expression is a minute, so a single line cannot run every 30 seconds. Two lines can: one runs the job at the start of the minute, the other waits 30 seconds first. Better still, use a scheduler that supports seconds.

## What are the options?

- Two crontab lines, the second one starting with `sleep 30`.
- A systemd timer with `OnCalendar=*:*:0/30`, which understands seconds.
- An in-process scheduler with second precision, such as node-cron, sidekiq-cron or Laravel's everySecond tasks.
- pg_cron, which accepts an interval of 1 to 59 seconds on its own.
- A long-running worker with its own loop, which is often the right design for work that never really stops.

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

The [every 30 seconds](https://cronmissed.com/cron/every-30-seconds.md) page has the same workaround with its daylight saving behavior.

## How should I monitor a job this frequent?

A heartbeat check watches a schedule; it is not built to receive a ping every few seconds. CronMissed accepts up to five recorded pings a minute per check and has a minimum period of 60 seconds, so for a 30 second job ping once a minute, from one of the two lines, or after every Nth pass of a loop.

```crontab
* * * * * /usr/local/bin/poll.sh && curl -fsS --retry 3 https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10
* * * * * sleep 30; /usr/local/bin/poll.sh
```

Set a simple check with a period of 60 seconds and a grace of two or three minutes. That alerts within minutes when polling stops, which is the right scale for a job that runs 2,880 times a day.

## What goes wrong at this frequency?

- Overlaps: a run that takes longer than 30 seconds meets the next one. Use a [lock](https://cronmissed.com/learn/overlapping-cron-runs.md).
- Process churn: starting a new interpreter twice a minute adds up. A resident worker avoids it.
- Log growth: two runs a minute fill a log quickly. Log only what you will read.

## Questions

### Is a one-second schedule possible?

With a scheduler that supports it, yes. For monitoring, a heartbeat once a minute is almost always enough; per-second health belongs in metrics.

### Can CronMissed check every 30 seconds?

The shortest period of a check is 60 seconds, and a check records up to five pings a minute. Ping once a minute and let the job do the work in between.

## Sources

- [systemd.timer manual page](https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html), read 22 October 2026
- [pg_cron README](https://github.com/citusdata/pg_cron), read 22 October 2026
- [Laravel documentation: task scheduling](https://laravel.com/docs/13.x/scheduling), read 22 October 2026

## Related pages

- [/cron/every-30-seconds](https://cronmissed.com/cron/every-30-seconds.md)
- [/cron/every-minute](https://cronmissed.com/cron/every-minute.md)
- [Supabase Cron and pg_cron](https://cronmissed.com/guides/supabase-pg-cron.md)
- [node-cron](https://cronmissed.com/guides/node-cron.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Cron every 30 seconds: crontab workaround](https://cronmissed.com/cron/every-30-seconds.md)
- [Cron every minute: * * * * *](https://cronmissed.com/cron/every-minute.md)
- [Monitor Supabase Cron and pg_cron jobs](https://cronmissed.com/guides/supabase-pg-cron.md)
- [Monitor node-cron scheduled tasks](https://cronmissed.com/guides/node-cron.md)
