I have to schedule a task on every 4 months, starting from november 1st, using quartz scheduler. I was using cronExpression
for the same. But cronExpression
will reset every year. So my task will execute in November, January, may etc. But I want it to be executed on November, march, july etc. Also, the same kind of problem exists while scheduling every 2 and more days in a month,it will reset in the next month. That is the next month the job will run on the 1st day.
How to solve this issue? Example code is given below.
Cron format 0 0 12 1 */4 ? * Start time Thursday, November 15, 2012 11:44 AM
- Tuesday, January 1, 2013 12:00 PM
- Wednesday, May 1, 2013 12:00 PM
- Sunday, September 1, 2013 12:00 PM
- Wednesday, January 1, 2014 12:00 PM
- Thursday, May 1, 2014 12:00 PM