javaJava @Scheduled
@Scheduled(cron = "0 */5 * * * *")fieldsField breakdown
- SEC0at second 00-59
- MIN*/5on minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 550-59
- HR*during every hour0-23
- DOM*on every day of the month1-31 · L · W
- MON*in every month1-12 · JAN-DEC
- DOW*on every day of the week0-7 · MON-SUN · L · #
next runsNext executions (UTC)
| time | date | in |
|---|---|---|
| 02:55:00 | Sun, 4 Oct 2026 | in 3 min |
| 03:00:00 | Sun, 4 Oct 2026 | in 8 min |
| 03:05:00 | Sun, 4 Oct 2026 | in 13 min |
| 03:10:00 | Sun, 4 Oct 2026 | in 18 min |
| 03:15:00 | Sun, 4 Oct 2026 | in 23 min |
mistakesCommon mistakes
- Writing "*/5 * * * *" (five fields). That is Unix cron; Spring needs the leading seconds field.
- Forgetting to anchor the seconds field: "*/5 * * * * *" would run on seconds 0, 5, 10 … of every minute.