Score:1

/etc/systemd/system/anacron.service.d missing

cn flag

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.

hr flag
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).
cn flag
Thank you so much! I actually thought of doing it, but I was afraid I could "mess up" things.
hr flag
Can you confirm whether it actually works? The solution was posted previously [here](https://askubuntu.com/a/1313639/178692) but received 0 upvotes. If it works we should probably upvote that and close this as a duplicate.
cn flag
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.
hr flag
No rush - it would just be nice to know ;)
cn flag
I'm back, thank you again, it works!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.