Does this cron expression mean every other Sunday?

自古美人都是妖i 提交于 2019-12-11 04:06:48

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2819523/does-this-cron-expression-mean-every-other-sunday

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!