From owner-freebsd-questions@FreeBSD.ORG Sat Mar 24 20:38:45 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66C0D16A405 for ; Sat, 24 Mar 2007 20:38:45 +0000 (UTC) (envelope-from lars+lister.freebsd@adventuras.no) Received: from mail.adventuras.no (mail.adventuras.no [194.63.250.215]) by mx1.freebsd.org (Postfix) with ESMTP id E5D1C13C465 for ; Sat, 24 Mar 2007 20:38:44 +0000 (UTC) (envelope-from lars+lister.freebsd@adventuras.no) Received: from [84.209.202.7] (hjem [84.209.202.7]) (authenticated bits=0) by mail.adventuras.no (8.12.10/8.12.10) with ESMTP id l2OKGfGo032299 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 24 Mar 2007 21:16:45 +0100 Message-ID: <46058728.9090003@adventuras.no> Date: Sat, 24 Mar 2007 21:16:40 +0100 From: Lars Kristiansen User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Matthew Seaman References: <4605724B.6000000@infracaninophile.co.uk> In-Reply-To: <4605724B.6000000@infracaninophile.co.uk> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Adventuras-MailScanner-Information: Please contact the ISP for more information X-Adventuras: du kan filtrere etter AdvSpamScore over 5-10 X-Adventuras-SpamCheck: not spam, SpamAssassin (not cached, score=-4.16, required 6, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.24, BAYES_00 -2.60) X-MailScanner-From: lars+lister.freebsd@adventuras.no X-Spam-Status: No Cc: questions@freebsd.org, Jeffrey Goldberg Subject: Re: log rotation recommendations X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Mar 2007 20:38:45 -0000 Matthew Seaman skrev: > 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. It is also possible to put a call for newsyslog within a script. Then you can do your preferred preprocessing, call newsyslog with a specialized config for the event, which should take care of HUPing the application, and then do postprocessing like moving files to folders, renaming to include the date or whatever. Regards, Lars > Cheers, > > Matthew >