[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Anacron timing



Hi,

I installed anacron on my Debian 10 and I just want to be sure to understand how it works on Debian (I've read there are some distro-dependent configurations, including Debian) before I have some bad surprises ;)

Let's say I have a specific job "toto" inside /etc/cron.daily. This is one of the easiest use case.
Because I've installed anacron, everything in that directory is dealt with anacron, not cron.

Anacron seems to be launched via systemd timers, especially this one: /etc/systemd/system/timers.target.wants/anacron.timer <http://timers.target.wants/anacron.timer>

As I want my jobs to be launched during the night included and on battery as well, I have:
* modified /etc/systemd/system/timers.target.wants/anacron.timer <http://timers.target.wants/anacron.timer>: I've replaced "OnCalendar=*-*-* 07..23:30" by "OnCalendar=*-*-* *:00"
* created a file /etc/systemd/system/anacron.service.d/on-ac.conf with the following content:
[Unit]
ConditionACPower=

Questions:
* Is my understanding above correct please?
* Is anacron launched during startup as well or does it just depend on anacron.timer?
* Is it true that I cannot be 100% sure that my job "toto" will be launched at least 1x/day with this configuration? For example, if later today I'm putting my PC on hibernation or sleep mode and I'm waking it up tomorrow from 14:10 to 14h50 only, my job won't be triggered, right? If so, would it be really heavy for the system to modify /etc/systemd/system/timers.target.wants/anacron.timer <http://timers.target.wants/anacron.timer> into "OnCalendar=*-*-* *:*/10"?

Thank you in advance :)
Best regards,
l0f4r0


Reply to: