Search code examples
quartz-schedulercrontrigger

how to fire Quartz Scheduler's cronTrigger every 10 minutes starting at 11am and ending at 3pm everyday?


I'm using "0 0/10 11-15 * * ?" cron expression to fire the trigger. But the trigger is fired even after 3pm.


Solution

  • Try cron "0 0/10 11-14 * * ?". the - in quartz cron expression is used to specify a range. So your cron means the trigger to be fired at 11:00, 12:00, 13:00, 14:00 and 15:00, repeat every 10 minutes and ending at 11:50, 12:50, 13:50, 14:50 and 15:50. That's why it is fired after 3pm.