public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Bug in run-crons?
@ 2021-12-12 18:21 Frank Steinmetzger
  2021-12-12 18:41 ` Rich Freeman
  0 siblings, 1 reply; 11+ messages in thread
From: Frank Steinmetzger @ 2021-12-12 18:21 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-12-13 22:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-12 18:21 [gentoo-user] Bug in run-crons? Frank Steinmetzger
2021-12-12 18:41 ` Rich Freeman
2021-12-12 19:07   ` Frank Steinmetzger
2021-12-13 20:18     ` Rich Freeman
2021-12-13 21:19       ` Frank Steinmetzger
2021-12-13 21:33         ` Michael Orlitzky
2021-12-13 21:38           ` Frank Steinmetzger
2021-12-13 21:42             ` Michael Orlitzky
2021-12-13 21:54               ` Rich Freeman
2021-12-13 22:03                 ` Frank Steinmetzger
2021-12-13 22:26                   ` Wols Lists

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox