I am setting up logrotate & realized that a few of the options are either incorrectly explained/understood.
My logrotate rotate 52
keyword is creating 52 files of the same log every time it rotates (daily).
localhost_access_log.2014-10-23.txt.1.gz
localhost_access_log.2014-10-23.txt.2.gz
localhost_access_log.2014-10-23.txt.3.gz
localhost_access_log.2014-10-23.txt.4.gz
localhost_access_log.2014-10-23.txt.5.gz
localhost_access_log.2014-10-23.txt.6.gz
localhost_access_log.2014-10-23.txt.7.gz
localhost_access_log.2014-10-23.txt.8.gz
localhost_access_log.2014-10-23.txt.9.gz
localhost_access_log.2014-10-23.txt.10.z
localhost_access_log.2014-10-23.txt.11.gz
localhost_access_log.2014-10-23.txt.12.gz
localhost_access_log.2014-10-23.txt.13.gz
localhost_access_log.2014-10-23.txt.14.gz
I haven't found a way for it to delete older log files using its in-built capability.
Can someone explain why it would make 52 compressed parts of a single day log file ?
How can I get it to delete logs older than 90 days using its inbuilt options like maxage
?
My config file is:
/var/log/localhost_access_log.*.txt {
copytruncate
daily
rotate 52
compress
missingok
create 640 tomcat7 tomcat7
}