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

One-time cron output?


I wanted to gather some opinions on this matter. I’ve recently applied
to the mlocate package a patch I received to skip running the daily
update of the database if the system is running on batteries.

When that happens, the daily cron script emits a warning like “System on
battery power, not running updatedb.” I think it’s going to be bad
emitting that warning each time mlocate skips running updatedb, because
it could be a lot of times.

On the other hand, I don’t like the idea of being completely silent,
because the database could go un-updated for a long time without the
user ever knowing why.

I’d like to make the script check for the existence of a file like
/var/lib/mlocate/on_battery_warning_done.touch, and only emit the
warning if it does not exist (and then touch it). (And possibly prefix
the warning with the words “One-time warning:”.)

Does this sound appropriate, or does it sound like an overkill? If it
doesn’t sound appropriate, do you think always emitting the warning, or
never emitting it, is more appropriate?


- Are you sure we're good?
- Always.
        -- Rory and Lorelai

Reply to: