I've edited /etc/logrotate.d/apache2 to rotate the logs for a virtual host. The virtual host's logs are in a separate location. That file now looks similar to below:
/var/log/apache2/*.log /srv/www/mysite.com/logs/*.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
}
However, it does not seem to rotate the logs in the /srv/www/... folder. I've even tried running it manually after deleting the state file in /var/lib/logrotate/status
How can I configure logrotate so that it properly rotates the log? Any help is appreciated!
I am on Ubuntu 10.04 server.