简体   繁体   English

星期一在 Windows 10 中使用 Java 的双周调度程序作业的 Cron 表达式

[英]Cron expression for biweekly scheduler job on Monday in Windows 10 using Java

I have created a scheduler with two triggers to implement a biweekly scheduler Java program on Windows 10 using Cron expression.我创建了一个带有两个触发器的调度程序,以使用 Cron 表达式在 Windows 10 上实现双周调度程序 Java 程序。 The two jobs are executed individually one each on alternate Monday of every month at 2pm, so maybe on even alternates or odd alternates.这两个工作在每个月的另一个星期一下午 2 点单独执行,因此可能在偶数交替或奇数交替上执行。 The current Cron expressions in use are as follows -当前使用的 Cron 表达式如下 -

"0 0 14 ? * MON#1"
"0 0 14 ? * MON#3"

I want to implement both these jobs with a single trigger and thus a single Cron expression , but not able to club these two Cron expressions .我想用一个触发器和一个Cron 表达式来实现这两个作业,但不能合并这两个 Cron 表达式 Need help!需要帮忙!

Quartz cron triggers do not support multiple "Nth" days. Quartz cron 触发器不支持多个“Nth”天。

However, if you do not mind, you can use a CalendarIntervalTrigger that is more suitable for this type of a schedule.但是,如果您不介意,您可以使用更适合此类日程安排的 CalendarIntervalTrigger。 The following screenshot (from QuartzDesk GUI) shows you a CalendarIntervalTrigger with settings that cover your use-case.以下屏幕截图(来自QuartzDesk GUI)向您展示了一个 CalendarIntervalTrigger,其设置涵盖了您的用例。

双周 CalendarIntervalTrigger 示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM