Crontab time format question

for Linux crontab time format

*/22 * * * *

shouldn"t it be executed every 22 minutes?

but look at the output

14:44:00
15:00:00
15:22:00

Why is it that at 44 minutes, it should be 66 after 22 minutes, that is, 6 minutes after the next hour? why is there zero?

Mar.04,2021

from Wikipedia

https://en.wikipedia.org/wiki/Cron

Please note that frequencies generally cannot be expressed; only the number of steps evenly divided into their ranges indicates the exact frequency (minutes and seconds, that is, 2 go) 3 / 4 / 5 / 6 / 10 / 12 / 12 / 15 / 20 and / 30, because 60 is divisible by these numbers; a few hours, i.e. / 2 / 2 / 3 / 4 / 6 / 6 / 8 and / 12); All other possible "steps" and all other areas produce inconsistent "short" periods at the end of the "reset" to the next minute, the next day or before the next day; for example, depending on months and leap years, the date field of entering * / 5 is sometimes executed 2 or 3 days later; This is because cron is stateless (it doesn't remember the last time it was executed, nor does it calculate the difference between it and now, which is needed for accurate frequency counting-on the contrary, cron is just a pattern matcher).

Google translation, there may be inarticulate.


first of all, / not the usage in the POSIX standard
then, the step frequency can only be set to the value of "divisible time span".
for example, for minutes and seconds, the step frequency can be 2, br, 3, 4, 5, 6, 10, 12, 12, 15, 12, 20, 30,
for hours, the step frequency can be 2, 3, 4, 4, 6, 8, 12, 12,

cron is just for pattern matching. It is stateless and does not record when you start executing.
so if it is not divisible, it will have an unexpected effect

.
for minutes and seconds, that's / 2, / 3, / 4, / 5, / 6, / 10, / 12, / 15, / 20 and / 30
because 60 is evenly divisible by those numbers;
for hours, that's / 2, / 3, / 4, / 6, / 8 and / 12

Cron

quoted from wiki

this is performed every 22 minutes, not every 22 minutes, with 22 minutes * give it a try

Menu