3

7:10am on MON-FRI每个月在星期六早上 7:20开火。

  1. 0 10 7 ? * 周二至周五
  2. 0 20 7 ? * 周六

如何编写一个cron表达式来实现。有什么方法可以合并1和2吗?

创建其他触发器有点难看。

目前,我的课程扩展了org.quartz.CronTrigger。和下面的 xml 文件。

<bean id="tradeReportJobTrigger" parent="abstractTrigger">
    <property name="job" ref="tradeReportJob"/>
    <property name="cronExpression" value="0 0 9 ? * TUE-SAT"/>
</bean> 

谢谢。

4

3 回答 3

2

根据我的理解,cron我认为你需要这两个条目来做你想做的事。

于 2011-12-16T06:07:41.660 回答
0

Judging from the Quartz Scheduler 2.0 API page describing Cron Expressions, the answer in Quartz Scheduler is similar to the answer in regular cron:

  • No; you cannot combine the two expressions into one single one.
于 2011-12-16T07:17:32.570 回答
0

It's not possible to combine this into a single expression. How about adding a second CronTrigger Bean refering to the same job?

于 2011-12-16T07:18:30.230 回答