用于日常 Quartz 作业的 Cron 触发器
像往常一样,我在为 Quartz 作业设置 Cron 计时器表达式时遇到了麻烦。如果我想每天在 2245 小时运行一个作业,表达式应该是:
0 45 22 * * 吗?
As usual, I'm having trouble with setting a Cron timer expression for a Quartz job. If I want to run a job daily at 2245 hours, should the expression be:
0 45 22 * * ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
他们的 教程 相当不错:-)
字段顺序为
“年份”,是可选字段。
*
表示every
,dayofmonth 和 dayofweek 也可以采用?
值,表示无特定值
。通常,其中一个字段将获取?
值。所以你的触发器说:
应该工作。
Their tutorial is pretty nice though :-)
The field order is
Year is an optional field.
*
meansevery
and dayofmonth and dayofweek can also take the?
value, meaningno specific value
. Typically one of the fields will get the?
value.So your trigger says:
Should work.
我想如果你没有任何问题,你就不会问这个问题,但你列出的语法应该有效:
你正在使用 Quartz 的 CronTrigger?这些格式也适用:
I'd imagine you wouldn't be asking the question if you didn't have any problem, but the syntax you listed should work:
You're using Quartz's CronTrigger? These formats would also work:
正确的格式是 0 0/45 22 * * ?
教程由fvu非常有用。
The correct format is 0 0/45 22 * * ?
Tutorial mentioned by fvu was very useful.