Common Spring schedules
Six fields with seconds first for @Scheduled(cron = …). Sunday is 0 or 7, both day fields must match, and L, W and # work. 46 of these 47 schedules can be written directly in Spring; the rest link to a tested workaround. Field rules are in the Spring reference.
Every few minutes or seconds
- 0 * * * * *Every minute
- 0,30 * * * * *Every 30 seconds
- 0 */2 * * * *Every 2 minutes
- 0 */5 * * * *Every 5 minutes
- 0 */10 * * * *Every 10 minutes
- 0 */15 * * * *Every 15 minutes
- 0 */20 * * * *Every 20 minutes
- 0 0,30 * * * *Every 30 minutes
- 0 0,45 */3 * * *and 2 more linesEvery 45 minutesEvery 45 minutes, counted from midnight
- 0 0 */3 * * *and 1 more lineEvery 90 minutesEvery 90 minutes, counted from midnight
Hourly
- 0 0 * * * *Every hourEvery hour, on the hour
- 0 30 * * * *Every hour at half pastAt minute 30 of every hour
- 0 0 */2 * * *Every 2 hours
- 0 0 */3 * * *Every 3 hours
- 0 0 */4 * * *Every 4 hoursAt 00:00, 04:00, 08:00, 12:00, 16:00 and 20:00
- 0 0 */6 * * *Every 6 hoursAt 00:00, 06:00, 12:00 and 18:00
- 0 0 */8 * * *Every 8 hoursAt 00:00, 08:00 and 16:00
- 0 0 0,12 * * *Every 12 hoursAt 00:00 and 12:00
Daily
Weekdays and weekly
- 0 0 9 * * MON-FRIEvery weekday at 9amAt 09:00, Monday through Friday
- 0 0 10 * * SUN,SATEvery weekend at 10amAt 10:00, at weekends
- 0 */15 9-17 * * MON-FRIEvery 15 minutes in business hoursEvery 15 minutes from 09:00 through 17:45, Monday through Friday
- 0 0 9-17 * * MON-FRIEvery hour in business hoursOn the hour from 09:00 through 17:00, Monday through Friday
- 0 0 9 * * MONEvery Monday at 9amAt 09:00, on Mondays
- 0 0 17 * * FRIEvery Friday at 5pmAt 17:00, on Fridays
- 0 0 0 * * SUNEvery Sunday at midnightAt 00:00, on Sundays
- 0 0 9 * * MON,WED,FRIMonday, Wednesday and FridayAt 09:00, on Mondays, Wednesdays and Fridays
- 0 0 9 * * TUE,THUTuesday and ThursdayAt 09:00, on Tuesdays and Thursdays
- WorkaroundEvery two weeksEvery other Monday at 09:00, with a date check
Monthly
- 0 0 0 1 * *First day of the monthAt 00:00, on the 1st of the month
- 0 0 0 1,15 * *1st and 15th of the monthAt 00:00, on the 1st and the 15th of the month
- 0 0 0 */2 * *Every 2 daysAt 00:00, every 2 days of the month, from the 1st
- 0 0 0 L * *Last day of the monthAt 00:00, on the last day of the month
- 0 0 9 1W * *First weekday of the monthAt 09:00, on the weekday nearest the 1st of the month
- 0 0 9 LW * *Last weekday of the monthAt 09:00, on the last weekday of the month
- 0 0 9 * * MON#1First Monday of the monthAt 09:00, on the first Monday of the month
- 0 0 9 * * TUE#2Second Tuesday of the monthAt 09:00, on the second Tuesday of the month
- 0 0 9 * * FRILLast Friday of the monthAt 09:00, on the last Friday of the month