[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: recursive finds, kernels, and laptops

Joey Hess writes:

> An even nicer solution would be to install anacron (cron is a poor
> choice for a laptop since it's not usualy on 27/7), and modify
> /etc/cron.d/anacron so that it doesn't run anacron if the laptop isn't
> on wall power. The effect is that, anacron takes over all the cron
> jobs that debian normally installs, and it will wake up once a day at
> some time and run them. But if the laptop's not plugged in, it won't
> run at all. The jobs will be put off until the next anacron run when
> your laptop's plugged in.

I hadn't seen anacron--it looks like it's geared more to computers which
are *off*, and I actually never turn off my laptop, I just put it in
suspend mode.  When it wakes up, running programs think that a lot of
time has passed since they got to run (true enough).  I'll take a look
at anacron, though, since it does look useful.

Incidentally, this "lots of time has elapsed" thing causes minor
flakiness with wmifs when the machine comes out of suspend mode.  I
imagine there are a lot of things which expect to get to run around once
a second, and don't deal well when "sleep(1);" doesn't come back for
eight hours.

In any case, I don't think what you detail really solves the problem.
There *are* cron jobs that I'd like to execute, even when I don't have
power.  For example, I still want runq to run every now and then to make
sure my mail is delivered in a timely fashion.  And I might want the
calendar cron job to run so that I'll get mail about appointments if I
leave my laptop in suspend mode overnight.

Ideally, cron jobs could tell cron "run me at midnight, or when the
power comes back on line, whichever comes first."  Then, soon after I
plugged my laptop in, it would run all its "find /"s and "ls -R"s.  But
I'd be very pleased if the system was just smart enough to run all that
stuff at the normal times, but only if the power is on.

Neale Pickett, propellerhead       Contact information in headers
Los Alamos National Laboratory, Network Engineering Group (CIC-5)

Reply to: