cron - Crontab timing working not as expected -
i have backup script syncing files every 3rd day.
# m h dom mon dow 0 5 */3 * * backup /home/backup/scripts/system_backup.sh
today checking backup , there none.
i expected, because today 27th, 27 / 3
number, execute.
the timestamps of other backups contain days 19
, 22
, 25
shouldn't execute on days 18
, 21
, 24
, 27
?
a timestamp of server right fri jun 27 08:52:00 utc 2014
.
from man page crontab(5)
:
step values can used in conjunction ranges. following range ``/'' specifies skips of number's value through range.
basically, means values used @ 0-based indexes divisible <number>
.
for dom, *
same 1-31
. */3
1-31/3
. means it'll start @ 1 (index 0) add 3 next 1 (4, @ index 3) , on.
if want cron run on days divisible three, can use 3-31/3
instead.
Comments
Post a Comment