[wplug] Configuring logrotate

Arnaud Loos arnaud at arnaudloos.com
Fri Mar 4 15:30:17 EST 2005


I'm having a problem with logrotate hopefully someone can help me with. I
have my windows servers sending event log messages to a Debian Syslog-NG
server. The logs are named server_name.year.month and are contained in
/var/log/windows. For readability sake I truncate the logs when they reach
20M and copy them off to a backup folder using the following entry in
logrotate.

/var/log/windows/* {
    errors email at me.com
    olddir /var/log/windows_backup
    size=20M
    rotate 30
    nocreate
}

This works great except at the beginning of the month I have an overlap.
When I come in on the first of the month I have 2 files for each server.
(Ex. server.2005.02 and server.2005.03) Since the '03' file is the only one
that will continue to grow and eventually surpass 20M I have to manually
rename and move the '02' files.

I tried adding the following in my logrotate.conf just below the previous
example but it didn't achieve the desired effect. I can't see that it did
anything at all in fact.

/var/log/windows/* {
    errors email at me.com
    olddir /var/log/windows_backup
    monthly
    rotate 30
    nocreate
}

I haven't been able to find an example in the man page or online that
achieves my goal. Any ideas?

Arnaud-





More information about the wplug mailing list