anacron deliberately doesn't run if the machine is running on battery power. This is fine if the only jobs are "housekeeping" tasks that it's safe to skip, but if you have critical jobs like backups then it's not so good. This is a dangerous situation as users are unlikely to notice that this feature exists until it's too late, e.g. when they want to recover something from a backup.

I suggest:

1. This feature needs to be documented, at the very least in README.Debian. Actually looking at bug #83334 message #40 a patch was submitted that added "anacron will avoid running while the system is battery powered" to that file, but that either never made it in to the package or it has subsequently been removed. But I don't think documentation alone is sufficient, as users familiar with anacron from non-laptops will be able to set up their jobs without referring to any documentation and won't learn about this feature (until it's too late).

2. There needs to be some way to enable or disable this feature, and I'd suggest that it should be disabled by default. A debconf question and/or /etc/default/anacron variable would be a possible method.

3. Better than a global enable/disable setting would be to indicate that some jobs are deferrable, and should only be run on ac power, and others are critical and should be run unconditionally. This could be done using different directories or a naming convention.

A related problem is that some jobs may require network connectivity while others don't. I can imagine a scheme where job names include tags, e.g.

/etc/cron.daily/man_db--acpower - only run when on ac power, doesn't need network /etc/cron.daily/backup--net - run even when on battery, only if network is up

You can specify a job pattern on the anacron command line to specify the tags to match in the current run.


Regards,  Phil.






--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to