cron 每 X 的确切含义

sti*_*vlo 6 cron

在 cron 中,您可以指定 */n,其中 n 表示每 n 次周期,例如在第一列中是分钟。

*/5 means every 5 minutes, but which minutes? 0, 5, 10, ...?
Run Code Online (Sandbox Code Playgroud)

如果指定的数字不是 60 的除数会怎样?

*/7 what will happen, will it start to skew in the next hour?
Run Code Online (Sandbox Code Playgroud)

Kev*_*vin 8

它将继续 7, 14, ... 56, 0, 7, 14, ...

使用这种语法,我喜欢将其视为 t mod x === 0


cjm*_*cjm 6

在 crontab 中,*first-last(wherefirst是最小可能值,last是最大可能值)的简写。

语法first-last/step手段“每一个N地方N >= first,并N <= last(N - first) % step == 0”。

所以*/7以分钟表示与0,7,14,21,28,35,42,49,56. 但1-59/7意味着1,8,15,22,29,36,43,50,57