1

I'm using Lubuntu LTS 20.04.3 and I'm an unexperienced user. I'm trying to set my anacron service running on battery, since by default it only runs when on AC power. I'm running on systemd and I thoroughly read both the anacron man and /usr/share/doc/anacron/README.Debian. It is said that in order to enable anacron running on battery in a systemd environment I should create this file /etc/systemd/system/anacron.service.d/on-ac.conf. Now, the issue is that anacron.service.d doesn't exist, nor any other anacron related directory. I'm sure it's a stupid question, but I'd be extremely grateful if anybody could help me with that.

  • You can likely just create the directory yourself - afaik, files (and directories) in /etc/systemd are for "local" overrides of the defaults in /etc/systemd/system/ so don't necessarily exist (but should be read and processed if they do). – steeldriver Jan 08 '22 at 14:53
  • Thank you so much! I actually thought of doing it, but I was afraid I could "mess up" things. – Raffaele Bruno Jan 08 '22 at 15:31
  • Can you confirm whether it actually works? The solution was posted previously here but received 0 upvotes. If it works we should probably upvote that and close this as a duplicate. – steeldriver Jan 08 '22 at 15:41
  • Is there a way I can run anacron immediately, to see if it works on battery? I'm currently waiting for my next scheduled job to run, to see if it works and get back to you. – Raffaele Bruno Jan 08 '22 at 16:44
  • No rush - it would just be nice to know ;) – steeldriver Jan 08 '22 at 17:39
  • I'm back, thank you again, it works! – Raffaele Bruno Jan 08 '22 at 20:54

0 Answers0