skip_on_battery not working
I was attempting to work from a coffee shop this morning. After powering on my machine, I noticed that libredefender was attempting to run a scan, killing my battery.
Laptop: Lenovo Thinkpad P14s (AMD - Cezanne)
Laptop State prior - Fully Powered off. (Not in standby or hibernate)
Config:
[scan]
excludes = [
# git repositories
"/home/brogers/git/**/*",
]
## by default libredefender spawns one thread per cpu core
## set to 1 to use a single thread
#concurrency = 1
concurrency = 4
skip_hidden = false
#skip_larger_than = "30MiB"
[update]
## use data fetched by clamav-freshclam.service (default)
path = "/var/lib/clamav"
[schedule]
preferred_hours = "22:00:00-09:00:00"
## Do not run scans when on battery
skip_on_battery = true
I'm unsure if the logs will display anything useful. However, please let me know if log output would be helpful and which log to provide.
If you could provide the logs I would have at least something to look at. Here's the output I get when running libredefender scheduler while being on battery:
[2022-09-01T20:31:10Z INFO libredefender::scan] Initializing with libclamav 0.105.1
[2022-09-01T20:31:10Z INFO libredefender::schedule] Battery is discharging, skipping this scan
[2022-09-01T20:31:10Z INFO libredefender::schedule] Sleeping for 24h 0m 0s (2022-09-02 22:31:10 +02:00)...
I just pushed in #34. Could you please build the latest state in the PR and provide the output of libredefender scheduler -v. That should provide some additional information and make debugging easier.
I'm assuming this is because the skip_on_battery feature was never released/shipped yet, I have a local branch to bump dependencies and add a libredefender dump-config subcommand to help debug this in the future, hopefully I can push it today. :)
I've release 0.6.0, feel free to let us know if the issue persists so we can reopen this issue. :)