Debian Bug report logs - #466193
Skip job while on battery power option

Package: backupninja; Maintainer for backupninja is Debian backupninja maintainers <[email protected]>; Source for backupninja is src:backupninja (PTS, buildd, popcon).

Reported by: "Adam Porter" <[email protected]>

Date: Sun, 17 Feb 2008 07:39:01 UTC

Severity: wishlist

Tags: wontfix

Forwarded to https://labs.riseup.net/code/issues/2810

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Micah Anderson <[email protected]>:
Bug#466193; Package backupninja. (full text, mbox, link).


Acknowledgement sent to "Adam Porter" <[email protected]>:
New Bug report received and forwarded. Copy sent to Micah Anderson <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: "Adam Porter" <[email protected]>
To: [email protected]
Subject: Skip job while on battery power option
Date: Sun, 17 Feb 2008 01:32:24 -0600
Package: backupninja
Severity: wishlist
Tags: patch

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.

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 (on my laptop,
which runs Ubuntu...Debian on my desktop, but I don't run it without
it being plugged in, of course). The changes are the adding of lines
276-291.  Then the default config file should be updated, and
ninjahelper too, I guess, though that's over my head right now.




Information forwarded to [email protected]:
Bug#466193; Package backupninja. (full text, mbox, link).


Acknowledgement sent to Micah Anderson <[email protected]>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Micah Anderson <[email protected]>
To: Adam Porter <[email protected]>, [email protected]
Subject: Re: Bug#466193: Skip job while on battery power option
Date: Sun, 23 Mar 2008 12:08:29 -0400
[Message part 1 (text/plain, inline)]
Hi Adam,

Sorry for the delayed response.

* Adam Porter <[email protected]> [2008-02-16 23:41-0500]:
> 
> 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.

This is a very good idea.

> 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.

Good approach, we will need to Recommend/Suggest on the package that
includes the /usr/bin/acpi binary (acpi).

> 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 (on my laptop,
> which runs Ubuntu...Debian on my desktop, but I don't run it without
> it being plugged in, of course). The changes are the adding of lines
> 276-291.  Then the default config file should be updated, and
> ninjahelper too, I guess, though that's over my head right now.

It doesn't look like there was anything attached to this. The best way
to provide a diff would be to take the most current version from the svn
trunk and do a unified diff against that and then send that. 

Thanks for doing this, I think it would be a very useful feature addition
Micah
[signature.asc (application/pgp-signature, inline)]

Information forwarded to [email protected], Micah Anderson <[email protected]>:
Bug#466193; Package backupninja. (full text, mbox, link).


Acknowledgement sent to intrigeri <[email protected]>:
Extra info received and forwarded to list. Copy sent to Micah Anderson <[email protected]>. (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: intrigeri <[email protected]>
To: Adam Porter <[email protected]>, [email protected]
Subject: Re: Bug#466193: Skip job while on battery power option
Date: Sun, 22 Jun 2008 23:29:13 +0200
Hello,

> Sorry for the delayed response.

What should I say, then...

> * Adam Porter <[email protected]> [2008-02-16 23:41-0500]:
>> 
>> 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.

> This is a very good idea.

Agreed.

>> 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.

> Good approach, we will need to Recommend/Suggest on the package that
> includes the /usr/bin/acpi binary (acpi).

Well, that’s a good starting point, but... a bit too ad-hoc for my
taste. There are not only ACPI laptops, but also APM, PMU, and maybe
some more. IMHO, a more generic way should be used to tell if the box
is running on battery power.

Does Debian, or the Linux kernel, already provides a generic interface
for this ? If not, maybe another program / lib already does this.
If not, we may have to invent our own wheel.

>> 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 (on my laptop,
>> which runs Ubuntu...Debian on my desktop, but I don't run it without
>> it being plugged in, of course). The changes are the adding of lines
>> 276-291.  Then the default config file should be updated, and
>> ninjahelper too, I guess, though that's over my head right now.

> It doesn't look like there was anything attached to this. The best way
> to provide a diff would be to take the most current version from the svn
> trunk and do a unified diff against that and then send that. 

Adam’s modified script[1] has been attached to the related Launchpad
entry[2].

[1] http://launchpadlibrarian.net/12045160/backupninja
[2] https://bugs.launchpad.net/ubuntu/+source/backupninja/+bug/192560

Bye,
-- 
  intrigeri <[email protected]>
  | clé gnupg @ http://gaffer.boum.org/intrigeri/intrigeri.asc
  | Que signifie ce pardon que tu me demandes ?
  | Faut-il toujours que tu cherches à être jugé-e ?




Information forwarded to [email protected], Micah Anderson <[email protected]>:
Bug#466193; Package backupninja. (full text, mbox, link).


Acknowledgement sent to intrigeri <[email protected]>:
Extra info received and forwarded to list. Copy sent to Micah Anderson <[email protected]>. (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: intrigeri <[email protected]>
To: Adam Porter <[email protected]>
Cc: [email protected]
Subject: Re: Bug#466193: Skip job while on battery power option
Date: Mon, 23 Jun 2008 16:44:57 +0200
Hello again,

intrigeri wrote (22 Jun 2008 21:29:13 GMT) :
> Well, that’s a good starting point, but... a bit too ad-hoc for my
> taste. There are not only ACPI laptops, but also APM, PMU, and maybe
> some more. IMHO, a more generic way should be used to tell if the box
> is running on battery power.

> Does Debian, or the Linux kernel, already provides a generic interface
> for this ? If not, maybe another program / lib already does this.
> If not, we may have to invent our own wheel.

The powermgmt-base package contains a /sbin/on_ac_power shell script
that manages ACPI, PMU and APM. The issue is... in case of ACPI, it
looks for the /proc/acpi/ac_adapter directory, that does not exist on
my desktop machine, and thus exits with code 255 (i.e. « Power status
could not be determined », according to the manpage).

Adam’s solution has the same issue :

$ acpi -a
No support for device type: battery
No support for device type: ac_adapter

$ acpi -a | grep 'on-line'
$

I don’t know if this is specific to the two desktop boxes I’ve run
these tests on, but it seems that non-laptop boxes have no way to tell
if they are running on AC power... which seems quite logical, since
they obviously are.

My proposal is then to :
  - use the runonbattery option suggested by Adam, defaulting to "yes"
    as Adam’s did
  - in case runonbattery is set to "no", use powermgmt-base’s
    on_ac_power script to determine if the box is running on battery
  - suggest the powermgmt-base package
  - well-document the dependancy of runonbattery option on
    powermgmt-base package

A thing I’m not sure about is : do we really want to make this option
a per-job one ? It adds a bit of complexity to the user-configuration
that I’m not sure we want to add. Adam, could you please provide us
with an example of which jobs you may want to run on battery, and
which ones you don’t ?

Bye,
-- 
  intrigeri <[email protected]>
  | gnupg key @ http://gaffer.boum.org/intrigeri/intrigeri.asc
  | So what?




Tags removed: patch Request was from [email protected] to [email protected]. (Mon, 23 Jun 2008 20:15:02 GMT) (full text, mbox, link).


Information forwarded to [email protected], Micah Anderson <[email protected]>:
Bug#466193; Package backupninja. (Tue, 05 Jan 2010 14:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to intrigeri <[email protected]>:
Extra info received and forwarded to list. Copy sent to Micah Anderson <[email protected]>. (Tue, 05 Jan 2010 14:27:03 GMT) (full text, mbox, link).


Message #27 received at [email protected] (full text, mbox, reply):

From: intrigeri <[email protected]>
To: "Adam Porter" <[email protected]>
Cc: [email protected]
Subject: Re: Bug#466193: Skip job while on battery power option
Date: Tue, 05 Jan 2010 15:23:45 +0100
Hi,

Adam Porter wrote (17 Feb 2008 07:32:24 GMT) :
> 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.

Until someone comes up with a mergeable patch, please note the new
"halt" function can be used in a .sh handler to abort all backups
unless $CONDITION is not met.

Bye,
--
  intrigeri <[email protected]>
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr-fingerprint.asc
  | Do not be trapped by the need to achieve anything.
  | This way, you achieve everything.




Set Bug forwarded-to-address to 'https://labs.riseup.net/code/issues/2810'. Request was from [email protected] to [email protected]. (Wed, 30 Mar 2011 17:36:02 GMT) (full text, mbox, link).


Added tag(s) fixed-upstream. Request was from [email protected] to [email protected]. (Thu, 23 Feb 2012 16:44:15 GMT) (full text, mbox, link).


Added tag(s) wontfix. Request was from intrigeri <[email protected]> to [email protected]. (Sat, 25 Feb 2012 12:36:16 GMT) (full text, mbox, link).


Removed tag(s) fixed-upstream. Request was from [email protected] to [email protected]. (Mon, 25 Feb 2013 16:51:20 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Thu May 15 13:11:21 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.