Arian
Arian

Reputation: 7719

Quartz - schedule jobs every two Weeks regardless of the start time

What is the cron expression for the following schedule :

Monday and Tuesday at 8:00 am, every 2 weeks.

Can we define "Every 3 weeks" regardless of the the start time ? (I don't care if it's every 3 weeks starting from the first week of the month or year, I want to run it for 5 years and literally every 3 weeks)

Upvotes: 0

Views: 907

Answers (1)

mam10eks
mam10eks

Reputation: 1086

You can't find a cron expression that meets your schedule. For example this howto states, that:

You need a SimpleTrigger or CalendarIntervalTrigger to schedule biweekly fire points.

I think you need two Simple Triggers to define a schedule like "Monday and Tuesday at 8:00 am every 2 weeks", namely one biweekly trigger for each monday, and just like that one biweekly trigger for each tuesday.

Similarly you could tackle the "Every 3 weeks" problem.

Upvotes: 1

Related Questions