java 石英调度程序:在本月的最后一天运行
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4962011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
quartz scheduler: run on last day of the month
提问by mkoryak
I need to run a job on the last day of every month. i tried the following cron expression:
我需要在每个月的最后一天运行一项工作。我尝试了以下 cron 表达式:
<property name="cronExpression" value="0 0 3 L * * *" />
but got this error:
但得到这个错误:
Caused by: java.lang.UnsupportedOperationException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.
it doesnt like the L
, but without using it, how can i run on the last day of the month?
它不喜欢L
,但不使用它,我如何在本月的最后一天运行?
回答by mdrg
Just change your trigger to
只需将触发器更改为
0 0 3 L * ?
One of day of week or day of month needs to be ?
. You cannot specify both.
一周中的某一天或一个月中的某一天必须是?
。您不能同时指定两者。