Subject: Log rotation
To: None <current-users@netbsd.org>
From: Peter Seebach <seebs@plethora.net>
List: current-users
Date: 02/18/2005 16:24:43
Is there anything other than newsyslog.conf which offers reasonably convenient
log rotation?  BSD/OS had a program called "rotate" which could rotate a file,
optionally compressing, on a regular basis.

Newsyslog looks plausible, but it requires active maintenance; you can't
just point it at a directory or wildcard pattern.

One likely solution would be to add wildcarding to newsyslog.

The underlying problem, of course, is that you ideally want to rotate all the
logs at once, then kick Apache a single time, instead of sending Apache a new
SIGHUP every second or so while you chew through a large virtual hosts list.

Suggestions?  I'm assuming there's folks doing this elsewhere, but everything
I've seen has been hand-rolled.  It seems to me that this ought to be the
kind of problem NetBSD is good at solving.

One consideration is that, arguably, the best thing to do is to rename all the
log files, then sighup apache, then do any compression later.  This sounds
almost like a custom app.

Logrotate sorta works, but it seems like it would substantially increase
the number of processes running.

-s