Tags

,

On CentOS and RHEL, take advantage of an automatic, daily cron job that runs logrotate.  This example rotates the default logs and my custom logs using a wildcard in the directory for random vhosts.

In /etc/logrotate.d/httpd:

/var/log/httpd/*log /var/www/html/public/*/*log {
missingok
notifempty
sharedscripts
daily
rotate 7
delaycompress
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}

 

Advertisements