Run a cron job every 30 seconds
*/30 * * * * *
Check it below, then take the line for any of 17 schedulers.
Click to edit · paste a crontab line · hover a field for its values
Every 30 seconds.
Nothing to watch out for on Spring @Scheduled.
@Scheduled(cron = "*/30 * * * * *", zone = "UTC")
public void job() { ... } Details
Upcoming runs
Calendar Every day
Between two dates
Daylight saving
When things go wrong Server off: Skipped
- Server was off
- Skipped. Schedules live in memory.
- Last run still going
- Never overlaps. The next run is timed from when the last one ended, so slots that pass are skipped.
- A run fails
- Logged and suppressed. Later runs still happen.
- Time zone
- The scheduler's zone, or zone = on the annotation.
- Precision
- 1 second.
Sources: github.com,docs.spring.io
Other schedulers As written in 4 of 16
- ✗ Debian / Ubuntu cron Debian / Ubuntu cron takes 5 fields: minute hour day month weekday. Debian / Ubuntu cron can't run this: it has no seconds field; a minute is the smallest step. vs RunWisp
- ✗ cronie cronie takes 5 fields: minute hour day month weekday. cronie can't run this: it has no seconds field; a minute is the smallest step. vs RunWisp
- ✗ BusyBox crond BusyBox crond takes 5 fields: minute hour day month weekday. BusyBox crond can't run this: it has no seconds field; a minute is the smallest step.
- ↻ systemd timer
*-*-* *:*:00/30 UTCsystemd timer uses OnCalendar=, not cron lines. vs RunWisp - ✓ RunWisp
*/30 * * * * * - ✗ Kubernetes CronJob Kubernetes CronJob takes 5 fields: minute hour day month weekday. Kubernetes CronJob can't run this: it has no seconds field; a minute is the smallest step.
- ✓ Ofelia
*/30 * * * * *vs RunWisp - ✗ Dagu Dagu takes 5 fields: minute hour day month weekday. Dagu can't run this: it has no seconds field; a minute is the smallest step. vs RunWisp
- ✓ PM2 cron_restart
*/30 * * * * *vs RunWisp - ✓ Jobber
*/30 * * * * *vs RunWisp - ✗ GitHub Actions GitHub Actions takes 5 fields: minute hour day month weekday. GitHub Actions can't run this: it has no seconds field; a minute is the smallest step.
- ✗ GitLab CI schedule GitLab CI schedule takes 5 fields: minute hour day month weekday. GitLab CI schedule can't run this: it has no seconds field; a minute is the smallest step.
- ✗ AWS EventBridge Scheduler AWS cron() needs a ? in either day-of-month or day-of-week. AWS EventBridge Scheduler can't run this: it has no seconds field; a minute is the smallest step.
- ✗ Google Cloud Scheduler Google Cloud Scheduler takes 5 fields: minute hour day month weekday. Google Cloud Scheduler can't run this: it has no seconds field; a minute is the smallest step.
- ✗ Jenkins Jenkins takes 5 fields: minute hour day month weekday. Jenkins can't run this: it has no seconds field; a minute is the smallest step.
- ↻ Quartz
*/30 * * * * ?Quartz needs a ? in either day-of-month or day-of-week.
✓ works as written · ↻ different syntax · ≠ runs at other times · ? not documented · ✗ can't
Every 30 seconds, in every scheduler
Works as written in 5 of 17. Times are UTC; the checker above takes any zone.
- Runs in 2027
- 1,051,200
- Days with a run
- 365
- Longest gap
- 30 s
Plain cron can't go below a minute. The usual crontab workaround is two lines, * * * * * cmd and * * * * * sleep 30; cmd, and the second run drifts if the first is slow.
| Scheduler | Line | Notes | |
|---|---|---|---|
| Debian / Ubuntu cron | ✗ | Debian / Ubuntu cron takes 5 fields: minute hour day month weekday. Debian / Ubuntu cron can't run this: it has no seconds field; a minute is the smallest step. | |
| cronie | ✗ | cronie takes 5 fields: minute hour day month weekday. cronie can't run this: it has no seconds field; a minute is the smallest step. | |
| BusyBox crond | ✗ | BusyBox crond takes 5 fields: minute hour day month weekday. BusyBox crond can't run this: it has no seconds field; a minute is the smallest step. | |
| systemd timer | ↻ | OnCalendar=*-*-* *:*:00/30 UTC | systemd timer uses OnCalendar=, not cron lines. |
| RunWisp | ✓ | */30 * * * * * | Works as written. |
| Kubernetes CronJob | ✗ | Kubernetes CronJob takes 5 fields: minute hour day month weekday. Kubernetes CronJob can't run this: it has no seconds field; a minute is the smallest step. | |
| Ofelia | ✓ | */30 * * * * * | Works as written. |
| Dagu | ✗ | Dagu takes 5 fields: minute hour day month weekday. Dagu can't run this: it has no seconds field; a minute is the smallest step. | |
| PM2 cron_restart | ✓ | */30 * * * * * | Works as written. |
| Jobber | ✓ | */30 * * * * * | Works as written. |
| GitHub Actions | ✗ | GitHub Actions takes 5 fields: minute hour day month weekday. GitHub Actions can't run this: it has no seconds field; a minute is the smallest step. | |
| GitLab CI schedule | ✗ | GitLab CI schedule takes 5 fields: minute hour day month weekday. GitLab CI schedule can't run this: it has no seconds field; a minute is the smallest step. | |
| AWS EventBridge Scheduler | ✗ | AWS cron() needs a ? in either day-of-month or day-of-week. AWS EventBridge Scheduler can't run this: it has no seconds field; a minute is the smallest step. | |
| Google Cloud Scheduler | ✗ | Google Cloud Scheduler takes 5 fields: minute hour day month weekday. Google Cloud Scheduler can't run this: it has no seconds field; a minute is the smallest step. | |
| Jenkins | ✗ | Jenkins takes 5 fields: minute hour day month weekday. Jenkins can't run this: it has no seconds field; a minute is the smallest step. | |
| Quartz | ↻ | */30 * * * * ? | Quartz needs a ? in either day-of-month or day-of-week. |
| Spring @Scheduled | ✓ | */30 * * * * * | Works as written. |
✓ works as written · ↻ different syntax · ≠ runs at other times · ? not documented · ✗ can't
Cron runs the line. Nobody tells you how it went.
RunWisp is an open-source cron replacement that ships as a single binary. It reads the same cron line and keeps a record of every run: output, exit code, duration.
# Debian / Ubuntu cron takes 5 fields: minute hour day month weekday. Debian / Ubuntu cron can't run this: it has no seconds field; a minute is the smallest step. [tasks.job]
cron = "*/30 * * * * *"
timezone = "UTC"
run = '/usr/local/bin/job.sh' | cron | RunWisp | |
|---|---|---|
| The server was off at run time | Skipped. anacron only catches up cron.daily, weekly and monthly. | Runs the most recent missed run at start-up (catch_up = 1) and sends a missed-run alert. |
| The last run is still going | Starts another copy on top. | Queues it. on_overlap = "queue" is the default. |
| A run fails | Output is mailed if MAILTO and a mail server work. No output, no mail, whatever the exit code. | Marked failed and sent to your alert channels. retry_attempts adds retries. |
Keep your crontab. sudo runwisp takeover runs it where it is and retires cron,
crontab -e keeps working, and runwisp service uninstall puts cron
back. It needs Linux with systemd; elsewhere, runwisp import cron converts the
file. RunWisp doesn't do L, W or #, and it runs
on one machine, not a cluster.
Moving from cron →
Questions
What does */30 * * * * * mean?
How do I run a job every 30 seconds in a crontab?
How do I run a job every 30 seconds with a systemd timer?
OnCalendar=*-*-* *:*:00/30 UTC. systemd timer uses OnCalendar=, not cron lines.How do I run a job every 30 seconds in a Kubernetes CronJob?
How do I run a job every 30 seconds in GitHub Actions?
How do I run a job every 30 seconds on AWS EventBridge?
Start in 30 seconds. Ship on your terms.
A single Go binary. If it doesn't earn the disk space, rm it. No account, no signup, no catch.
curl -fsSL https://get.runwisp.com | sh