huge /var/log/exim files
Scott Mitchell
scott+freebsd at fishballoon.org
Wed Aug 6 09:09:42 PDT 2003
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 at lorax:230 pwd
> /var/log/exim
> root at 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
More information about the freebsd-questions
mailing list