LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Easy logrotate question - remove rotated logs after 7 days (https://www.linuxquestions.org/questions/linux-newbie-8/easy-logrotate-question-remove-rotated-logs-after-7-days-897786/)

SmurfGGM 08-17-2011 04:06 AM

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 :)

chrism01 08-17-2011 06:58 PM

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.