Hi, it’s me again, :)

I’m currently improving the cron setup on my Gentoo-powered NAS. I installed
zfs-auto-snapshot, which includes scripts for hourly, daily, weekly and
monthly creation of snapshots.

The NAS uses fcron for its cron daemon. In order for the scripts to work,
I enabled the run-crons script from sys-process/cronbase, which runs all
scripts in /etc/cron.{hourly,daily,...}. But I have the feeling that there
is a bug in the script:

It uses state files in /var/spool/cron/lastrun/ to know when each interval
was last run, so it only runs once per period. But: the age threshold for
the state file is period + 5 minutes. Shouldn’t that be period - 5 minutes?

My reasoning: assume run-crons is run hourly, at the 0 minute sharp. So at
the next run, the state file is exactly one hour old. Since this is not old
enough for the check, run-crons thinks that the last run is too recent and
ignores this period. As a result, each period is only run on every other
iteration.

Any thoughts on that?
Cheerio.

-- 
Grüße | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

“Today I watched my first porn movie.” – “And?” – “I was so young back then.”

Attachment: signature.asc
Description: PGP signature

Reply via email to