Arun P Johny
Arun P Johny

Reputation: 388316

Cron expression like 26-Jun to 5-Jun/every 2nd day/repeat every year

I need a cron expression which will repeat every year between two specified dates.

Ex: Run between 26-May and 7-Jun every second day and repeat every year.

I need to write something like a birthday reminder.

The best I came up with is

0 0 0 26-7 5-6 ? *

Will this work?

Thank you

Upvotes: 0

Views: 301

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388316

I didn't find any solution to solve this problem with a single cron expression, so I broke it down to two different expressions.

0 0 0 26-31 5 ? *

and

0 0 0 1-7 6 ? *

Upvotes: 0

Related Questions