There is a known behavior of anacron not to run when the laptop is running on batteries. Is there any way to stop this behavior and run anacron whatever the power state?
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=152402
http://www.mail-archive.com/[email protected]/msg560900.html
https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/36816
Please never change any files in
/usr
! Instead, you may change a line in the file/etc/default/anacron
toANACRON_RUN_ON_BATTERY_POWER=yes
Thanks @Teresa e Junior. :)
I found how to do this and summarized it in my blogpost
http://opensourceresearchtips.blogspot.com/2012/01/linux-anacron-tips.html
To change this behavior of anacron do the following:
and change to
For Debian based systems using systemd look at
/usr/share/doc/anacron/README.Debian
for instructions on creating/etc/systemd/system/anacron.service.d/on-ac.conf
. The README tells what contents the file should be created with. This worked for me running daily snapshots with rsnapshot. I Have only tried this on Ubuntu 20.04. It seems likely that other distros may have a similar README in that directory./etc/default/anacron
has instructions to look in/usr/share/doc/anacron/README.Debian
in Ubuntu 20.04. Thanks so much @mzuther : )Just in case the README is not on someone's system the file contents should be: