Easy logrotate question - remove rotated logs after 7 days
Hi there,
I have this set up to rotate apache log files everyday and then remove the rotated .gz logs after 7 days, but it is not removing them ... /var/log/apache2/access_log /var/log/apache2/error_log /var/log/apache2/suexec.log /var/log/apache2/ssl_request_log /var/log/apache2/ssl_engine_log /var/log/apache2/*/*error_log /var/log/apache2/*/*access_log { daily compress maxage 7 rotate 7 missingok create 644 root root postrotate /etc/init.d/apache2 reload endscript } Is maxage and rotate the same ? man page for logrotate maxage: Remove rotated logs older than <count> days man page for logrotate rotate: Log files are rotated <count> times before being removed or mailed Cheers :) |
You should only need 'daily' & 'rotate 7'. maxage is for if you don't care about num of logs, just how old they are.
|
All times are GMT -5. The time now is 02:21 PM. |