java - 每小时在 50 到 60 分钟之间安排一次作业
问题描述
我正在尝试在春季使用@Schedule,我想知道是否可以选择使用 cron 在 50 分钟到 59 分钟之间每小时运行一次,例如:它将运行:13:58、14:52 , 15:57 16:50 等...
谢谢
解决方案
看这个例子:
0 50-59/1 * * *
从 crontab 手册页,第 5 节:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)
A field may be an asterisk (*), which always stands for ``first-last''.
Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, 8-11 for an
``hours'' entry specifies execution at hours 8, 9, 10 and 11.
Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: ``1,2,5,9'', ``0-4,8-12''.
推荐阅读
- html - primeng 单选按钮活动未居中
- java - 如何在 Intellij Idea-2017.2.5 中更改文件创建的评论日期格式?
- javascript - 将两个动作连接到一个减速器?
- rebus - 使用 Rebus.MessageValidation 包可以进行哪些消息验证?
- ios - CAGradientLayer 位置不正确
- android - Android - RecyclerView 边框线颜色
- vbulletin - 辅助检查/更正 vBulletin 数据库的软件工具
- c# - 后处理:在特定图层上禁用运动模糊
- vb.net - 如何使用 vb.net 根据另一个下拉列表值更改下拉值
- tomcat - 来自 F5 负载均衡器虚拟 IP 时,Tomcat 8.5 不服务 http 请求