user339383
user339383

Reputation: 23

Does this cron expression mean every other Sunday?

Does the following cron expression mean "execute every other Sunday?"

0 0 3 ? * 2/1 *

I'm trying to use it with the Spring Quartz scheduler.

Upvotes: 2

Views: 3585

Answers (2)

laz
laz

Reputation: 28638

The expression you are asking about fires at 3 am Monday to Saturday. From the Quartz Javadoc you could try using the two expressions 0 0 3 ? * 1#1 * and 0 0 3 ? * 1#3 * to execute on the 1st and 3rd Sundays of the month. The D#N syntax lets you pick the Nth day D of the month.

Upvotes: 3

Pointy
Pointy

Reputation: 413717

No, I don't think so. I think "2/1" means "Tuesday through Sunday." I'm not sure that it's possible to express "Every other Sunday", because there'd have to be a "week of month" field or something like that.

Upvotes: 0

Related Questions