When a laptop doesn't have AC power plugged in, the /etc/cron.daily/slocate job should not start because it takes alot of power from the battery. Also the updatedb job should start niced and, if possible even ioniced. I created a modified /etc/cron.daily/slocate script for myself and just wanted it to share. I don't know if the acpi/AC power detection works on all laptops, just wanted to share the idea. Reproducible: Always Steps to Reproduce: 1. unplug ac power 2. wait until updatedb cronjob starts
Created attachment 207962 [details] /etc/cron.daily/slocate /etc/cron.daily/slocate which starts updatedb whith ionice and nice and doesn't start updatedb at all when ac-power is unplugged
Created attachment 207963 [details] /etc/cron.daily/slocate reversed defaults for fault tolerance
Comment on attachment 207963 [details] /etc/cron.daily/slocate except the ACSTATEFILE you use is not universal. some people have multiple AC's. look at the latest openrc code as an example.