Is this cronExpression right?

I do not know if the following expression is true:

<property name="cronExpression" value="0  0  12  2  *  MON-FRI ?"/> 

I'm trying to set my trigger to fire every second day of every month, no matter the year, at noon, and the day of the week should be between Monday and Friday.

I would really appreciate if anyone could help me. Thanks in advance.

+3
source share
2 answers

You cannot specify the day of the month and day of the week - it is not supported.

+3
source

I assume that you mean "every second day (every other day), until it is MON-FRI."

According to the Quartz CronTrigger Tutorial :

'1/3' " " " 3 , ".

, 1/2 " , ". cronExpression, 0 0 12 1/2 * MON-FRI *, , .

org.quartz.CronExpression.isValidExpression("0  0  12  1/2 * MON-FRI *")

... , .

, :

CronExpression e = new CronExpression("0  0  12  1/2 * MON-FRI *");
e.isSatisfiedBy(new DateTime(2012, 9, 26, 12, 0, 0, 0).toDate());

... :

> Exception in thread "main" java.lang.UnsupportedOperationException:
> Support for specifying both a day-of-week AND a day-of-month parameter
> is not implemented.

, jhouse , cronExpression.

, - : cron cron Nth Hour/Day/Week/Month

+3

Source: https://habr.com/ru/post/1780556/


All Articles