cronuru
Pattern

Every 5 Seconds

*/5 * * * * *
0/5 * * * * ?

Runs every 5 seconds. Requires a seconds-aware dialect — Spring or Quartz — because standard Unix cron is minute-precision only.

Use in your stack

{
  "schedule": {
    "cron": "0/5 * * * * ?",
    "timezone": "UTC"
  }
}
// 6-field: second minute hour day-of-month month day-of-week
@Scheduled(cron = "*/5 * * * * *")
public void everyFiveSeconds() {
    // ...
}

// Simpler for pure intervals — no cron parser needed:
@Scheduled(fixedRate = 5000) // milliseconds
public void everyFiveSecondsFixedRate() {
    // ...
}

Next runs

Pick a timezone to see when this expression fires next.

Next 10 runs
  1. 012026-07-03T16:50:35.000Z
  2. 022026-07-03T16:50:40.000Z
  3. 032026-07-03T16:50:45.000Z
  4. 042026-07-03T16:50:50.000Z
  5. 052026-07-03T16:50:55.000Z
  6. 062026-07-03T16:51:00.000Z
  7. 072026-07-03T16:51:05.000Z
  8. 082026-07-03T16:51:10.000Z
  9. 092026-07-03T16:51:15.000Z
  10. 102026-07-03T16:51:20.000Z

Variations

*/10 * * * * *

Every 10 seconds

*/30 * * * * *

Every 30 seconds

0 * * * * *

Every minute (Spring)

Common use cases

  • Polling a fast-changing queue or message broker for new work.
  • Updating a live dashboard or real-time metric during development.
  • Health-checking a low-latency service that needs sub-minute detection.
  • Draining a buffer to a downstream system on a tight cadence.

Gotchas

  • **Unix crontab cannot do this.** The 5-field format has no seconds field; its minimum interval is `* * * * *` (every minute). Kubernetes CronJob and GitHub Actions inherit the same limit.
  • In Spring, `*/5 * * * * *` is the 6-field form (seconds first). Don't confuse it with Unix's 5-field `*/5 * * * *`, which means every 5 *minutes*.
  • In Quartz, use `0/5 * * * * ?` — the `0/5` seconds field means "starting at second 0, every 5 seconds," and `?` fills the unused day-of-week field.
  • For anything this frequent, a `fixedRate`/`fixedDelay` loop is often simpler and cheaper than a cron parser. Use `@Scheduled(fixedRate = 5000)` in Spring or `tokio::time::interval` in Rust.
  • Overlap is a real risk at 5-second cadence — if the job ever takes longer than 5 seconds, runs stack up. Prefer `fixedDelay` (waits for the previous run) or an in-flight guard.

Standard cron — the kind in /etc/crontab, Kubernetes CronJobs, and GitHub Actions — has five fields starting at minutes. There is no seconds field, so “every 5 seconds” simply isn’t expressible. The finest you can schedule is once a minute.

To go sub-minute you need a 6-field, seconds-first dialect:

But for an interval this tight, a plain timer is usually the better tool. Spring’s @Scheduled(fixedRate = 5000) and Rust’s tokio::time::interval(Duration::from_secs(5)) both express “every 5 seconds” without a cron parser — and they’re easier to reason about when a run might overrun its window.

Frequently asked questions

What is the cron expression for every 5 seconds?
In a seconds-aware dialect, every 5 seconds is `*/5 * * * * *` (Spring) or `0/5 * * * * ?` (Quartz). Standard Unix/crontab has no seconds field, so it cannot schedule every 5 seconds — its finest granularity is one minute (`* * * * *`).
Why doesn't `*/5 * * * *` run every 5 seconds?
`*/5 * * * *` is a 5-field Unix expression, and the first field is minutes — so it runs every 5 *minutes*. Unix cron has no seconds field at all. To get every 5 seconds you need a 6-field dialect where the first field is seconds, such as Spring (`*/5 * * * * *`) or Quartz (`0/5 * * * * ?`).
How do I run something every 5 seconds in Spring Boot?
Two options. With cron syntax: `@Scheduled(cron = "*/5 * * * * *")`. Or, more simply, with a fixed rate: `@Scheduled(fixedRate = 5000)` (the value is milliseconds). Use `fixedDelay = 5000` instead if you want each run to wait for the previous one to finish before the 5-second timer restarts.
Can Kubernetes CronJob run a job every 5 seconds?
No. Kubernetes CronJob uses the standard 5-field cron format with a one-minute minimum, so the fastest it schedules is once per minute. For sub-minute work, run a long-lived Deployment with an internal loop (e.g. `sleep 5`) or a language-level timer rather than a CronJob.

Browse all cron patterns

Every schedule Cronuru documents, with its expression and code snippets for six dialects.