Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

There is a known behavior of anacron not to run when the laptop is running on batteries. Is there any way to stop this behavior and run anacron whatever the power state?

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=152402

http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg560900.html

https://bugs.launchpad.net/ubuntu/+source/anacron/+bug/36816

share|improve this question
    
Are you sure it's up to anacron ? cron.daily/apt, cron.daily/mlocate and cron.daily/apt-xapian-index do call /usr/bin/on_ac_power explicitly to check whether the script is being run on a battery. You could probably just comment these conditions within those scripts as a solution. –  user40613 Jan 9 '12 at 21:28

1 Answer 1

up vote 1 down vote accepted

I found how to do this and summarized it in my blogpost

http://opensourceresearchtips.blogspot.com/2012/01/linux-anacron-tips.html

To change this behavior of anacron do the following:

 sudo gedit /usr/lib/pm-utils/power.d/anacron

and change to

case $1 in
    false)
 start -q anacron || :
 ;;
    true)
 start -q anacron || :
 ;;
esac
share|improve this answer
1  
Just edit /etc/default/anacron, and set ANACRON_RUN_ON_BATTERY_POWER to yes. You should never edit files in /usr. –  Teresa e Junior Oct 19 at 11:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.