Help - Search - Members - Calendar
Full Version: 80MB/day Access Log! How to force Awstats & Logrotate hourly?
The Planet Forums > Control Panels > cPanel/WHM
MegaMan2
My log files way are out of control. One of my domains is putting out a 80+MB/day access log. icon_sad.gif

As a result, I want to purge the logs every hour (or 2), but cannot lose my AWStats results. My idea is to use cron to run awstats.pl every hour at :00 and then force Cpanel to purge all logs every hour at :01. Problem is I can't figure it out. I've searched here, CPanel, AWStats, and DevShed, but I still don't have the answer. Surely someone has covered this before...

(1) Is this method a sensible approach?
(2) What's the proper SSH syntax for creating these crontabs?
amusive.com
I believe you just need to modify "Number of days between processing log files and bandwidth usage (default 1, decimal values are ok):" in tweak settings. Change it to .1 or something small like that and it will run more often. I'm almost positive when it processes the logs it runs stats.

You would then also choose "delete logs after stats run".

That MIGHT work.
MegaMan2
Yes. I've tried this. I have that setting at .05. Problem is that it does not purge the access logs. They just continue to grow.

AWStats does have a setting to automatically purge the file when it is run (inside awstats.conf) But it requires all access log permissions to be set to 777. So I tried that, but CPanel keeps automatically changing the permissions back to 644 or whatever...so AWStats can't purge correctly. rolleyes.gif
amusive.com
Do you have delete logs after stats run checked?

You can set what CPanel sets the log file permissions to in tweak settings as well.

"Chmod value for raw apache log files (0640 is the default):"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.