log rotation recommendations

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Mar 24 18:48:05 UTC 2007

Jeffrey Goldberg wrote:

> Having recently moved from Linux (SuSE) to FreeBSD (6.2-p3) I'm
> wondering what the recommended way of rotating logs (principally postfix
> and apache).  I see that logrotate, with which I'm familiar, is in
> ports.  I also see that there is a file /etc/newsyslog.conf, but it
> looks like newsyslog(8) only knows about HUPping syslogd.

Not so.  The optional 7th field in /etc/newsyslog.conf can contain a
file name to read a PID out of: that PID will be signalled when the
log is rotated. The optional 8th column can contain the signal number
to use -- by default SIGHUP is sent.  The newsyslog.conf(5) man page
explains all this in great detail.

Certainly for apache, you might alternatively consider the use of
rotatelogs(8) (comes with apache) or cronolog(8) (in ports as
sysutils/cronolog).  Or, indeed, logrotate if that's what you prefer.



Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070324/6144c88c/signature.pgp

More information about the freebsd-questions mailing list