From owner-freebsd-questions@FreeBSD.ORG Wed Aug 6 09:09:42 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 735F337B401 for ; Wed, 6 Aug 2003 09:09:42 -0700 (PDT) Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by mx1.FreeBSD.org (Postfix) with ESMTP id 491B943F75 for ; Wed, 6 Aug 2003 09:09:41 -0700 (PDT) (envelope-from scott@fishballoon.org) Received: from llama.fishballoon.org ([81.104.195.124]) by mta05-svc.ntlworld.comESMTP <20030806160940.MRSH7553.mta05-svc.ntlworld.com@llama.fishballoon.org>; Wed, 6 Aug 2003 17:09:40 +0100 Received: from scott by llama.fishballoon.org with local (Exim 4.20) id 19kQqN-000DN0-73; Wed, 06 Aug 2003 17:08:55 +0100 Date: Wed, 6 Aug 2003 17:08:55 +0100 From: Scott Mitchell To: "Kirk R. Wythers" Message-ID: <20030806160854.GA50741@llama.fishballoon.org> References: <1060184521.11385.32.camel@lorax.forestry.umn.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1060184521.11385.32.camel@lorax.forestry.umn.edu> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.8-RELEASE i386 Sender: Scott Mitchell cc: freebsd-questions@freebsd.org Subject: Re: huge /var/log/exim files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 16:09:42 -0000 On Wed, Aug 06, 2003 at 10:42:01AM -0500, Kirk R. Wythers wrote: > /var is full, and I see that /var/log/exim files are huge > > root@lorax:230 pwd > /var/log/exim > root@lorax:231 ls -lh > total 172088 > -rw-r----- 1 mailnull mail 102M Aug 6 10:32 mainlog > -rw-r----- 1 mailnull mail 6.8K Aug 5 03:01 paniclog > -rw-r----- 1 mailnull mail 66M Aug 5 16:00 rejectlog > > My question is this: If I rm mainlog and reject log, will they be built > again or is there a more subtle way to do this? > > Thanks, > > Kirk man newsyslog Newsyslog allows you to configure automatic rotation of log files. It's run automatically from cron every few minutes. For my Exim logs, I have the following in /etc/newsyslog.conf: /var/log/exim/mainlog mailnull:mail 640 7 * $D0 Z /var/log/exim/rejectlog mailnull:mail 640 7 * $D0 Z This means that the mainlog and rejectlog will be rotated every day at midnight ($D0), the old logs will be compressed (Z), and 7 older versions of each log will be kept. Although I notice that it actually seems to be keeping 8... Anyway, you can also set the permissions and ownership of the logs as I've done here. It's also possible to send a signal to a process to tell it to re-open its logs, but this isn't necessary with Exim. HTH, Scott