Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Aug 2003 17:08:55 +0100
From:      Scott Mitchell <scott+freebsd@fishballoon.org>
To:        "Kirk R. Wythers" <kwythers@umn.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: huge /var/log/exim files
Message-ID:  <20030806160854.GA50741@llama.fishballoon.org>
In-Reply-To: <1060184521.11385.32.camel@lorax.forestry.umn.edu>
References:  <1060184521.11385.32.camel@lorax.forestry.umn.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030806160854.GA50741>