I'm running Apache 1.33 on my Debian box and hosting a couple domains on it. In the httpd.conf I setup logging for the domains to go to their own subdirectory i.e.
/var/log/apache/domain.com
/var/log/apache/mail.domain.com
the default access and error logs are written to the root /var/log/apache/ directory and the access and error logs for the domains are in their own direcotry. I recently noticed that logrotate was rotating and compressing the logs in the /apache/ direcotyr but not the sub directories.
I found the apache file under /etc/logrotate.d/apache . What I'm wondering is if I changed the file to look like
Code:
/var/log/apache/*/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f /var/run/apache.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d apache reload > /dev/null; \
else \
/etc/init.d/apache reload > /dev/null; \
fi; \
fi;
endscript
}
Would that sucessfully rotate any .log file in the apache and sub directories?