how to configure logrotate utility to limit the size of log file
Hello,
I'm looking for a way to limit the file size of some of our log files. For instance, /var/log/messages might grow to over a few hundred megs on some of our boxes used for testing. What I'd like to do would be to limit the size of the /var/log/messages file to something like 50MB, and when additional data comes in, new log file got created with same name and old one zipped with name like messages.1.gz
i used logrotate with following configuration file placed in /etc/logrotate.d/mylog
/var/log/mylog {
rotate 5
size 100k
daily
delaycompress
}
then restart rsyslog service and reload logrotate with logrotate -f mylog command .
but logsizes is going beyond specified (100k) limit
Anyone done something similar?
Thanks,
prabhakar
|