I hope this has not been mentioned before. I only found in mentioned in a comment of a devblog post.
Please describe the problem.
With git annex assistant
running, consistency checks is sometimes triggered while the computer is battery-powered (as opposed to plugged into AC).
What steps will reproduce the problem?
Configure git annex assistant
to make consistency check daily (or whatever the default is), unplug from power and wait.
What version of git-annex are you using? On what operating system?
5.20141231
on Archlinux 64 bit. (From the changelog I guess it's also present in the newest version).
Please provide any additional information below.
It would be nice if one could toggle whether consistency check may run while not plugged into AC.
I agree this would be nice. However, how to detect if it's on battery?
Debian has a
on_ac_power
command which is rather complicated; 88 lines of code that deal with APM, PMU (powerpc), and two different kernel interfaces for ACPI (new sysfs and old /proc/acpi).Then there's OSX, Windows, Android..
I'm going to move this from bugs to todo.
/sys/class/power_supply/BAT0/
... There's something calledpmset
for macs, but I don't have a mac so I don't know how relevant it is. For Windows there seems also to be some sort of api, but again I don't know anything about windows...