Don't run when off AC power
Bug #192560 reported by
Adam Porter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
backupninja |
New
|
Undecided
|
Unassigned | ||
backupninja (Debian) |
Confirmed
|
Unknown
|
|||
backupninja (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: backupninja
When using backupninja on a laptop, it would be nice to be able to choose to not run certain jobs when off AC power. I don't want to use my limited battery power running a backup, I'd rather wait until I plug the system in.
Changed in backupninja (Debian): | |
status: | Unknown → New |
Changed in backupninja (Debian): | |
status: | New → Confirmed |
To post a comment you must log in.
I have modified backupninja to check if a job is not supposed to be run on battery power, and if not, if the system is on battery power. It checks for a "runonbattery" option (which defaults to "yes") in the main section of each backup job's config file in /etc/backup.d, and uses "acpi -a" and grep to check the power status.
I'm not sure of the right way to supply a diff, so I will attach /usr/sbin/ backupninja, changed from 0.9.4-6ubuntu4. Then the default config file should be updated, and ninjahelper too, I guess, though that's over my head right now.
Hopefully this can be merged into Ubuntu and Debian. I'd suggest upstream, but it hasn't even released 0.9.5 yet, though it's had several changes since 0.9.4.