Search code examples
javaspring-bootcronquartzcrontrigger

Create a cron that runs every friday with a specific interval


I want to create a cron that runs in this interval 16/01/2023 - 15/06/2023 every friday at 12 o'clock.

The cron that i created is "0 0 12 ? 1-6 FRI 2023" but i do not know how to put the days interval for january and june.


Solution

  • AFAIK you cannot. Probable 3 schedules:

    0 0 12 16-31 1 FRI 2023
    0 0 12 ? 2-5 FRI 2023
    0 0 12 1-15 6 FRI 2023