[comp.sys.ncr] cronlogs on 600 & 650

nigel@cmsfl@labtam.oz (Nigel Harwood) (03/01/90)

The Tower 32/650 under 2.01.01 has a nice feature where cron automatically
limits its /usr/lib/cron/log to a reasonable size.

This feature is not available on a Tower 32/600 under 1.03.00.

Any suggestions on the best way to do this ?

It sounded trivial to me initially until I found that cron keeps its
log open.  This means that if I do anything like copying the last
1000 lines to a new file and then moving the new file over the old,
cron will still have the handle to the old file.  As well as the problem
of the data cron is writing in the mean time.

Sounds to me like I need to stop cron and then deal with the log, restarting
it when I have finished.

I would however like to know if a nicer way exists than 'kill'ing it,
i.e. I wouldn't know what would happen to commands cron was running
at the time it was killed.

Comments, advice ?

Regards
-- 
<<<<<<<<<<<<<<<<<<<<<<<  Nigel Harwood  >>>>>>>>>>>>>>>>>>>>>>>>>
<< Post:  Coles Myer Ltd, PO Box 2000 Tooronga 3146, Australia >>
<< Phone: +61 3 829 6090      E-mail: nigel%cmsfl@labtam.oz.au >>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

wescott@Columbia.NCR.COM (Mike Wescott) (03/03/90)

In article <366@cmsfl> nigel@cmsfl@labtam.oz (Nigel Harwood) writes:
> The Tower 32/650 under 2.01.01 has a nice feature where cron automatically
> limits its /usr/lib/cron/log to a reasonable size.

It's not really that nice since it insists on writing to the console and
cron will hang if it can't get to the console, or if the console is in
flow control.

> Any suggestions on the best way to do this ?
> It sounded trivial to me initially until I found that cron keeps its
> log open.  This means that if I do anything like copying the last
> 1000 lines to a new file and then moving the new file over the old,
> cron will still have the handle to the old file.  As well as the problem
> of the data cron is writing in the mean time.

> Sounds to me like I need to stop cron and then deal with the log, restarting
> it when I have finished.

Your best bet is to periodically (via cron) run a script that checks the size
of the log.  Run this script at otherwise quiet times for cron (to avoid lost
log entries).  If the log is big enough, then copy it to olog and then truncate
the log.  Cron keeps the log file open but only appends so truncating will 
work as expected.

This is the way it works in later SysV releases.


--
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM