我是Spring和cron的新手,在我的代码中使用了以下表达式:“ * * / 1 * * *?”。我不知道这意味着什么。我已经在Google上搜索过,并在一些网站上尝试过此表达式:
https://www.freeformatter.com/cron-expression-generator-quartz.html#crongenerator
和
它告诉我,这意味着“关闭 每分钟从小时后的00:00开始的第二分钟”,第二个站点告诉我“每小时的每一分钟。”但是与Bug的日志相关联,我不知道实际上是什么时候触发的。
以下是日志摘录:
00:24:06.644 [scheduler-5] - Start of the scanning for operation X
00:24:31.397 [scheduler-5] - Start of the scanning for operation Y
00:31:02.535 [scheduler-5] - Start of the scanning for operation Z
00:34:08.458 [scheduler-5] - Start of the scanning for operation T
00:36:11.542 [scheduler-5] - Start of the scanning for operation A
00:38:56.887 [scheduler-5] - Start of the scanning for operation C
00:47:30.640 [scheduler-2] - Start of the scanning for operation I
00:50:19.578 [scheduler-5] - Start of the scanning for operation B
00:53:39.860 [scheduler-5] - Start of the scanning for operation J
00:56:24.648 [scheduler-5] - Start of the scanning for operation P
00:59:06.028 [scheduler-5] - Start of the scanning for operation F
01:02:16.596 [scheduler-5] - Start of the scanning for operation R
01:05:59.004 [scheduler-5] - Start of the scanning for operation N
01:14:06.190 [scheduler-5] - Start of the scanning for operation O
01:16:59.551 [scheduler-5] - Start of the scanning for operation G
01:19:16.718 [scheduler-5] - Start of the scanning for operation E
01:22:01.298 [scheduler-5] - Start of the scanning for operation H
01:24:26.732 [scheduler-2] - Start of the scanning for operation D
01:25:03.324 [scheduler-5] - Start of the scanning for operation S
01:26:29.480 [scheduler-5] - Start of the scanning for operation K
01:27:10.503 [scheduler-2] - Start of the scanning for operation L
01:28:46.531 [scheduler-5] - Start of the scanning for operation M
如何运行“关闭 每分钟从小时后的00分钟开始”或“在每小时之后的每分钟开始。”我听不懂。您能帮我理解吗?
答案 0 :(得分:0)
Spring cron expression
和Unix cron expression
之间有区别
春季cron:
second, minute, hour, day (of month), month, day (of week)
Unix-Cron:
minute, hour, day (of month), month, day (of week)
如果您每天都在寻找Spring表达式,请尝试以下操作:
"0 0 * * * *"