春天cron表达每30分钟后 [英] Spring cron expression every after 30 minutes

查看:172
本文介绍了春天cron表达每30分钟后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java spring - 我有cron工作的cron表达式。

  0 0/35 * * *?但是上面提到的cron表达式在一小时内触发一次,如下所示:






< b

1:35
2:35
3:35
4:35



我想

解决方案
>

Cron语法是

 秒分钟小时day_of_month month day_of_week年



所以你想要的是

  0 0 ,35 * * * *? 

所以它会在每小时0分和35分钟触发。



有关详情,请参阅 Quartz文档,如Spring正在使用Quartz作为调度程序。这些文档还解释特殊的字符*。 - ,和其他。


Java spring - I have following cron expression for cron job.

0 0/35 * * * ?

But above mentioned cron expression fires once in an hour and like as follows

1:35 2:35 3:35 4:35

I want to fire every after 35 mins instead once in an hour

any quick suggestion ?

解决方案

Cron syntax is

sec min hour day day_of_month month day_of_week year

So what you would want is

0 0,35 * * * * ?

So it will fire on minutes 0 and 35 of each hour.

See the Quartz docs for this, as Spring is using Quartz as scheduler here. Those docs also explain the special chars like * ? - , and others.

这篇关于春天cron表达每30分钟后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆