On Sun, Dec 12, 2021 at 1:21 PM Frank Steinmetzger <war...@gmx.de> wrote: > > 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.
I don't use this, but I believe there should be an hourly crontab entry that deletes the cron.hourly file, which would mean it gets run on the next 10min cycle (or maybe sooner - I'm not sure if those jobs are run in parallel or serial). The overall result is that things will get run at traditional crontab times no matter what, but if those are missed and enough time is accrued then run-crons will catch this and run the job on the next 10min cycle, such as a missed daily overnight slot. So if you don't have your computer on a 3AM then the job will get run a bit more than 24h after the last time it was run. Then if you leave it on overnight that night it will run at 3AM despite it not being 24h, but at that point if you leave it on it will run at 3AM daily since it will no longer be missed. The fixed times serve to anchor the actual execution times if you do leave the computer on. -- Rich