Quartz Cron expression :Run every 15 days ie twice in a month

25,702

Solution 1

I have tested this and the following expression works fine

        "0 0 0 1,15 * ?"

the 1,15 statement fires triggers on 1st and 15th of every month at 00:00 hours. You can change the first three zeroes to fire them at a particular time you want.

the 1st zero -> seconds

the 2nd zero -> minutes

the 3rd zero -> hours

Solution 2

0 0 1,15 * * “At 00:00 on day-of-month 1 and 15.”

0 0 1,15 1 * “At 00:00 on day-of-month 1 and 15 in January.”

0 0 1,15 1 6 “At 00:00 on day-of-month 1 and 15 and on Saturday in January.”

Solution 3

The following also works fine, it executes your command on the 15th and the 30th at 02:00 AM of every month:

0 2 */15 * * <yourCommand>
Share:
25,702
user3009116
Author by

user3009116

Updated on July 09, 2022

Comments

  • user3009116
    user3009116 almost 2 years

    I want to set the scheduler with a quartz cron expression which will trigger every 15 days ,for example 1st and 15th of every month.The 0 15 10 15 * ? is triggering only on 15th of every month.

  • karthik v
    karthik v about 6 years
    1st - min, 2nd - hour, 3rd - dom,4th - mon,5th - dow
  • chrlaura
    chrlaura almost 6 years
    True, but this no longer has a 15 day interval, as OP requested :-)
  • moodboom
    moodboom over 2 years
    is "quartz" different than standard linux cron (as described by karthik v)?