Question

i'm really confused on the formatting for crontrigger

http://quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger

ive been creating my own format for hours but to no avail :(

Edited*

what i need is to trigger every 10months, based on a specific date.

thanks :D

Was it helpful?

Solution

Cron syntax is too limited to support "every 10 months" semantics since 10 is not an even divisor of 12 (you can easily express every 2, 3, 4 or 6 months with cron).

What you need is a CalendarIntervalTrigger:

This trigger can achieve schedules that are not possible with SimpleTrigger (e.g because months are not a fixed number of seconds) or CronTrigger (e.g. because "every 5 months" is not an even divisor of 12).

OTHER TIPS

A cron expression is a string comprised of 6 or 7 fields separated by white space quartz-scheduler.org. Fields can contain any of the allowed values, along with various combinations of the allowed special characters for that field. The fields are as follows:

S.NO.  |   Field Name   |   Mandatory   |  Allowed Values   |  Special Characters 
 1.    |   Seconds      |     YES       |  0-59             |    , - * /
 2.    |   Minutes      |     YES       |  0-59             |    , - * /
 3.    |   Hours        |     YES       |  0-23             |    , - * /
 4.    |   Day of month |     YES       |  1-31             |    , - * ? / L W
 5.    |   Month        |     YES       |  1-12 or JAN-DEC  |    , - * /
 6.    |   Day of week  |     YES       |  1-7 or SUN-SAT   |    , - * ? / L #
 7.    |   Year         |      NO       |  empty            |    , 1970-2099 - * /

I used cronguru for creating my own cron expression.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top