Subject: Re: log files and rotation
To: None <current-users@NetBSD.ORG>
From: Bert Driehuis <>
List: current-users
Date: 08/06/1996 23:27:58
Chris wrote:

> Unfortunately, nothing run from cron can really do what I want
> (since if the system is down for a day, i.e. cron is not running,
> the jobs for that day won't happen, and i want rotation to happen in
> this case immediately after system startup).

There is one thing I like about rotating from cron with an old fashioned
0-n suffix, and that is that however badly you screw up your system date,
you will always have seven logfiles. Any scheme that renames logfiles to
include suffixes like 960806 needs some intelligent magic to clean up
outdated logs, and that actually entails a risk -- one which I've bumped
into too often in the past.

For my situation, I couldn't care less about rotating log files that became
outdated whilst the machine was down. If the machine is important, it won't
be down anyway. I want to be assured that when cron thinks it's 00:05
(daily for some, sunday night for others), my logfiles get rotated once,
and at most one file get zonked.

As long as that behaviour can be specified in a new and fancy newnewsyslog:
fine with me. But until that time, I'll stick to the beautiful shell-script
boilerplate I snarfed out of an older NetBSD release, and use across a
variety of machines at work.

Oh, and by the by: I love the feature that you can specify a script to be
run upon rotating by calling it /var/log/messages.scan. However, since on
many machines I can't trust the protections on /{usr,var}/{adm,log}, I
changed the script to look for /usr/local/etc/messages.scan instead. (The
amount of commercial stuff on the market that does chmod 777 /var/log in
order for their ill-designed piece of software to be able to create a log

Oh well, just my two bits...

                                        -- Bert

Bert Driehuis                 God, grant me the serenity to accept the things        I can't change, courage to change the things I
                              can, and the wisdom to know the difference.