Put the following into your /etc/logrotate.d/httpd
:
# use the standard parameters for error log
/var/log/httpd/error_log {
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd graceful 2> /dev/null || true
endscript
}
# and the non-standard ones for access log
/var/log/httpd/access_log {
compress
size 256M
rotate 9
nodateext
missingok
notifempty
sharedscripts
postrotate
/sbin/service httpd graceful 2> /dev/null || true
/path/to/your/stat/script < /var/log/httpd/access_log.1
endscript
}
And DON'T FORGET to move your /etc/cron.daily/logrotate
to /etc/cron.hourly/
(of course, if your logs grow fast enoght)