On my webserver I have this file: /etc/logrotate.d/apache2
I know it is logrotating /var/log/apache2/.log
, but if I want to add things that are in /usr/home/www/site1/logs/
.log
do I just duplicate everything below and stick that line in there? Each time I add a new site do I need to manually add lines to this file?
Or what is the most professional way to do this?
/var/log/apache2/*.log { weekly missingok rotate 52 compress delaycompress notifempty create 640 root adm sharedscripts postrotate if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then /etc/init.d/apache2 reload > /dev/null fi endscript }
How about:
In other words, just list all the paths you need, separated by spaces. Logrotate will then check all the paths. By the way you can also test your config as noted here with the debug option
-d
:In the output it will list all the files it checks: