I have a simple quartz trigger running in Spring 2.5.6-SEC01.
Trigger definition looks like this:
<bean id="AdvicesCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="AdvicesQuartzJob"/>
<property name="cronExpression" value="0 20/15 * * * ?"/>
</bean>
This is my scheduler factory:
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="AdvicesCronTrigger"/>
</list>
</property>
</bean>
I’ve read this documentation about firing CRON triggers from Quartz. This is an excerpt:
CronTrigger Example 1 – an expression
to create a trigger that simply fires
every 5 minutes"0 0/5 * * * ?"
Today I fired my program at 9:40. This is my execution output:
Edit: Bobby is right in his appreciation. I’ve updatted my execution log:
2010-02-11 09:50:00,000 INFO – START
2010-02-11 10:20:00,000 INFO – START
2010-02-11 10:35:00,000 INFO – START
2010-02-11 10:50:00,000 INFO – START
2010-02-11 11:20:00,000 INFO – START
2010-02-11 11:35:00,000 INFO – START
I expected that this trigger will be fired at
9:50
10:05
10:20
10:35
…
How to accomplish this? Which CRON expression use?
The
20/15part of the cron expression means every 15 minutes after the 20’th minute of the hour. This means that it will always start at the 20’th minute.I have never tested it but maybe an expression like this one would be what you are searching for :
0 */15 * * * ?