Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 3395

[Software] two different anacron activation time

$
0
0
hello,
As a new anacron user, I'm trying to understand the basics. I thought I understood how the anacron command was activated. I first consulted the manual :

Code:

man anacron......On Debian-based systems, anacron will be  activated  hourly  every  day       from 07:30 local time to 23:30 local time through cron job (on non-sys‐       temd systems where cron is installed and enabled) or systemd timer  (on       systemd-based systems).  On activation, anacron will check if it missed       some jobs. If yes, it will start those jobs after  a  short  period  of       time.
To be sure, I first checked that bookworm is based on systemd :
:

Code:

~$ ps -p 1 -o comm=systemd
So, “or the systemd timer (on systemd-based systems)" must be the right answer. I looked for an anacron timer linked to systemd and found one in /lib/systemd/system/anacron :

Code:

:/lib/systemd/system$ cat anacron.timer[Unit]Description=Trigger anacron every hour[Timer]OnCalendar=*-*-* 07..23:30RandomizedDelaySec=5mPersistent=true[Install]WantedBy=timers.target
Everything seems to match, except the activation times: 7:30am (cron job) and 7am (systemd timer).

Is there an explanation for this difference?

PS1: looking for an explanation I found this answer: https://ubuntuforums.org/showthread.php?t=2448045
7..23 means every hour from 7 to 23 - both inclusive. This means that the timer is repeated hourly from 7:30 to 23:30.
that would mean I'm misinterpreting systemd's timer syntax. my mistake!

PS2: Coming back to anacron.timer, if the last activation takes place at 23:30 to be an hourly activation, the first must take place at 7:30. But why choose 23:30 instead of 07 to start counting?

Statistics: Posted by mazda1 — 2025-02-27 08:56 — Replies 0 — Views 52



Viewing all articles
Browse latest Browse all 3395

Trending Articles