Web Hosting Talk







View Full Version : logrotate


Lmax
09-06-2001, 07:02 AM
Hi,

Logrotate compresses the log files everyday if they exceed the 1 MB. This is a good thing to preserve diskspace.
Only problem is that the logs are compressed before webalizer generates it reports. So on the days the log is compressed webalizer doesn't get any data.

How can i solve this. Is it possible to run webalizer first, and then logrotate. This would be the best solution. Else the compressed file is processed every day. Or can webalizer work with the compressed files??

Thanks

Lmax
09-06-2001, 06:38 PM
I found the solution through another channel. posting it here to help other people

Provided by Carrie Bartkowiak
->

That's part of the solution. Out of the box, Webalizer uses the logs themselves as a history and rebuilds the data *completely* every night. So what you want to do is get webalizer to run before logrotate, *and* set Webalizer to incremental mode, which will cause it to keep its own history files rather than relying on the logs for them.

1. Go into /etc/cron.daily and rename webalizer.pl to awebalizer.pl; for good measure rename logrotate to zlogrotate. Things in the cron folders are processed alphabetically.
mv webalizer.pl awebalizer.pl
mv logrotate zlogrotate
2. Open /etc/webalizer.conf and find the line that deals with Incremental, turn it to ON and uncomment it. In the section below it, give your history files a name (the default is fine) and uncomment it as well.

Then just for good measure, to get a head start on today's logs, go back to /etc/cron.daily and run webalizer manually one time.
/webalizer.pl