是否有办法将它设置为每天早上9:00:30开始,每30秒执行一次,直到9:30:00 ?
我的表达式是30/30 0-30 9 ? * MON-SUN
,但它不能做我想做的。
——编辑——
现在是9:00到9:30,计划将在30秒后执行
9:00:30 executed
9:01:30 executed
9:02:30 executed
9:03:30 executed
9:04:30 executed
...
...
9:30:30 executed
我想要的工作
9:00:30 executed
9:01:00 executed
9:01:30 executed
9:02:00 executed
9:02:30 executed
9:03:00 executed
9:03:30 executed
...
...
9:30:00 executed
请帮
您可以使用两个cron表达式来实现您想要的:
30 0-29 9 * * ?
从09:00:30到09:29:30每分钟执行一次
Output
09:00:30
09:01:30
09:02:30
09:03:30
09:04:30
...
09:29:30
0 1-30 9 * * ?
从09:01:00到09:30:00每分钟执行一次
Output
09:01:00
09:02:00
09:03:00
09:04:00
09:05:00
...
09:30:00