[Nottingham] logrotate issues
Mike Cardwell
nlug at lists.grepular.com
Fri Dec 11 10:18:05 UTC 2009
Hi,
I'm having issues with configuring logrotate on a Debian Lenny box and I
was wondering if anyone can help.
/var/log/mail.log is currently rotated on a daily basis, and at any one
time I have 7 full days, and the current day:
root at haven:/var/log# ls -l mail.log*
-rw-r----- 1 root adm 361480 2009-12-11 10:12 mail.log
-rw-r----- 1 root adm 2214948 2009-12-11 06:23 mail.log.0
-rw-r----- 1 root adm 205322 2009-12-10 06:25 mail.log.1.gz
-rw-r----- 1 root adm 179264 2009-12-09 06:25 mail.log.2.gz
-rw-r----- 1 root adm 196008 2009-12-08 06:25 mail.log.3.gz
-rw-r----- 1 root adm 155322 2009-12-07 06:25 mail.log.4.gz
-rw-r----- 1 root adm 158902 2009-12-06 06:26 mail.log.5.gz
-rw-r----- 1 root adm 194697 2009-12-05 06:23 mail.log.6.gz
root at haven:/var/log#
There is nothing in /etc/logrotate.d/ to do with mail.log so I assumed
it would just be using the default values in /etc/logrotate.conf
However, in /etc/logrotate.conf I have this:
========================================================================
root at haven:/var/log# cat /etc/logrotate.conf |egrep -v '^(#.*)?$'
weekly
rotate 4
create
compress
include /etc/logrotate.d
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
root at haven:/var/log#
========================================================================
That suggests to me that mail.log should be rotating on a weekly basis,
with 4 copies kept, not a daily basis with 7 copies kept... I tried
adding an explicit configuration block for /var/log/mail.log to the end
of /etc/logrotate.conf and it made no difference...
What on Earth is telling my system to rotate mail.log on a daily basis
and to only keep the last weeks worth of logs?
--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
Technical Blog: https://secure.grepular.com/blog/
More information about the Nottingham
mailing list