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

Re: PROPOSAL to serialize cron.{daily,weekly,monthly}

begin  Jesus Climent <jesus.climent@hispalinux.es> dedi ki:
> On Sun, Sep 05, 2004 at 04:45:54AM +0300, Abdullah Ramazanoglu wrote:
>> Please inform me if there's a better place to (cross)post this.
>> Current Situation:
>> cron.daily, cron.weekly, and cron.monthly gets triggered off at specific
>> times (everyday at 6:25, Sunday at 6:47 and 1st of the month at 6:52,
>> respectively) regardless of whether previous batch of maintenance scripts
>> has finished or not. This may result in parallel execution of scripts from
>> several batches, although each batch in itself is serialized. This, in
>> turn, can cause consequences ranging from wrong output to fatal script
>> clash. For instance a script from cron.daily might be scanning the volumes
>> for viruses, while a script from cron.weekly kicks in, force-unmounts
>> several volumes (killing the processes using those volumes BTW) and starts
>> backing up them. Examples are endless.
> Maybe we should put fcron in base?

I didn't use fcon to this date, so I installed it on a trial machine and
inpected it a bit. It seems like an excellent solution, and in fact
default woody fcron installs with *serialized* daily/weekly/monthly
entries in fcrontab. Perhaps the weekly entry should be changed from "%"
(once in a week anyday) to "&" (exact specific day and time). But I'm new
to fcrontab and I could well be confusing something.

It would also get rid of both cron and anacron. I'm not sure how a
blessing it is than a curse. On one hand it is a much cleaner and
versatile way, OTOH there is a well established cron tradition...

I guess it is beyond me to suggest something. It's upto distro compilers.
I would personally prefer fcron, though.


BTW I have noticed a stupid error on my previously suggested setup: While
in my setup, daily, weekly and monthly scripts work in a serial chain,
which is initiated by cron.daily, I forgot to reflect that fact to
anacrontab. Like in crontab, only cron.daily entry should have been active
in anacrontab. It caused no harm to me, because of the extended period
margins on weekly and monthly entries (the chain started by cron.daily
swept all batches long before anacron would trigger off weekly or montly
batch independently). So here is the final state of anacrontab:

/etc/anacrontab (snippet)::
1   5    cron.daily    nice run-parts --report /etc/cron.daily
# Original weekly and monthly entries commented out.
#7   10  cron.weekly   nice run-parts --report /etc/cron.weekly
#30  15  cron.monthly  nice run-parts --report /etc/cron.monthly

So the whole argument of buggy (too short) cron.monthly period and
providing additional 1 day latency margins for weekly and monthly batches
all go away by themselves.

Abdullah        | aramazan@ |
Ramazanoglu     | myrealbox |
________________| D.0.T cöm |__

Reply to: