Every 10 Seconds
*/10 * * * * * 0/10 * * * * ? Runs every 10 seconds. Requires a seconds-aware dialect — Spring or Quartz — because standard Unix cron is minute-precision only.
Use in your stack
# crontab has no seconds field, so tile the minute with six offset
# entries. flock -n skips a run if the previous one is still going,
# rather than letting invocations stack up.
* * * * * flock -n /tmp/poll.lock /usr/local/bin/poll.sh
* * * * * sleep 10; flock -n /tmp/poll.lock /usr/local/bin/poll.sh
* * * * * sleep 20; flock -n /tmp/poll.lock /usr/local/bin/poll.sh
* * * * * sleep 30; flock -n /tmp/poll.lock /usr/local/bin/poll.sh
* * * * * sleep 40; flock -n /tmp/poll.lock /usr/local/bin/poll.sh
* * * * * sleep 50; flock -n /tmp/poll.lock /usr/local/bin/poll.sh
# Cleaner on any systemd-based distro — /etc/systemd/system/poll.timer
# AccuracySec is NOT optional here: it defaults to 1min, which would
# collapse this back to once a minute.
# [Timer]
# OnCalendar=*-*-* *:*:00/10
# AccuracySec=1s
{
"schedule": {
"cron": "0/10 * * * * ?",
"timezone": "UTC"
}
}
// 6-field: second minute hour day-of-month month day-of-week
@Scheduled(cron = "*/10 * * * * *")
public void everyTenSeconds() {
// ...
}
// Simpler for pure intervals:
@Scheduled(fixedRate = 10000) // milliseconds
public void everyTenSecondsFixedRate() {
// ...
}
Next runs
Pick a timezone to see when this expression fires next.
- 012026-08-19T14:17:20.000Z
- 022026-08-19T14:17:30.000Z
- 032026-08-19T14:17:40.000Z
- 042026-08-19T14:17:50.000Z
- 052026-08-19T14:18:00.000Z
- 062026-08-19T14:18:10.000Z
- 072026-08-19T14:18:20.000Z
- 082026-08-19T14:18:30.000Z
- 092026-08-19T14:18:40.000Z
- 102026-08-19T14:18:50.000Z
Variations
Common use cases
- Polling a job queue or webhook backlog on a tight loop.
- Refreshing a near-real-time cache or leaderboard.
- Sampling a sensor or metric at 6× per minute.
- Retrying a flaky downstream call at a short, fixed cadence.
Gotchas
- **Unix crontab cannot do this in one line.** The 5-field format has no seconds field; its minimum interval is one minute. Kubernetes CronJob and GitHub Actions share that limit. The crontab workaround is six entries offset with `sleep` — see the Linux tab above.
- **If you use a systemd timer, you must set `AccuracySec=1s`.** It defaults to **1 minute**, so `OnCalendar=*-*-* *:*:00/10` on its own will not fire every 10 seconds — systemd is free to coalesce those firings into one per minute. This is the single most common reason a sub-minute timer silently doesn't work.
- The `sleep`-offset trick drifts. `sleep 10` starts when cron forks the job, not at the top of the minute, so under load the offset copies wander. Use `flock -n` so a slow run is skipped rather than stacked.
- In Spring, `*/10 * * * * *` is the 6-field form (seconds first) — not to be confused with Unix's `*/10 * * * *`, which means every 10 *minutes*.
- In Quartz, use `0/10 * * * * ?` — `0/10` in the seconds field means "from second 0, every 10 seconds," and `?` fills the unused day-of-week field.
- For a fixed interval like this, `@Scheduled(fixedRate = 10000)` (Spring) or `tokio::time::interval` (Rust) is usually simpler than a cron expression.
- Watch for overlap: if a run can exceed 10 seconds, use `fixedDelay` or an in-flight guard so invocations don't stack.
Unix cron starts at minutes — five fields, no seconds — so “every 10 seconds” can’t be written as a classic crontab line. The tightest standard cron gets is once per minute.
On Linux, without changing schedulers
Six crontab entries tile the minute: one on the minute, then five offset with sleep 10 through sleep 50 (the Linux tab above has the full block). It works, and for a low-stakes poll on a box you don’t control it’s a fair answer — but the offsets drift under load, because sleep starts when cron forks the job rather than at the top of the minute.
The better answer on any systemd distro is a timer:
[Timer]
OnCalendar=*-*-* *:*:00/10
AccuracySec=1s
That second line is not optional. AccuracySec defaults to 1 minute, so a sub-minute OnCalendar without it lets systemd coalesce every firing into one per minute — the timer looks correct and quietly runs 6× less often than you asked. See systemd timers for the full timer+service pair.
Or use a dialect that has seconds
For sub-minute schedules, reach for a 6-field, seconds-first dialect:
- Spring
@Scheduled(cron = "*/10 * * * * *")— details in the Spring cron reference and the Spring @Scheduled guide. - Quartz
0/10 * * * * ?— details in the Quartz cron reference.
For a plain fixed interval, a timer beats a cron parser: Spring’s @Scheduled(fixedRate = 10000) or Rust’s tokio::time::interval(Duration::from_secs(10)) both say “every 10 seconds” more directly.
For the full picture of which schedulers support seconds and what each platform’s real minimum is, see sub-minute scheduling.
Frequently asked questions
What is the cron expression for every 10 seconds?
How do I run a cron job every 10 seconds on Linux?
Why doesn't `*/10 * * * *` run every 10 seconds?
How do I run something every 10 seconds in Spring Boot?
Can Kubernetes CronJob run a job every 10 seconds?
More seconds schedules
Other patterns on the same cadence — or browse every schedule.