On our Tomcat servers I regularly see warnings like below:
/etc/cron.daily/tomcat8:
gzip: /var/log/tomcat8/app1/app1.log.gz already exists; not overwritten
gzip: /var/log/tomcat8/app2/app2.log.gz already exists; not overwritten
gzip: /var/log/tomcat8/app3/app3.log.gz already exists; not overwritten
gzip: /var/log/tomcat8/app4/app4.log.gz already exists; not overwritten
I found a similar issue as discussed in Tomcat7 logrotate: superx_default_xml.log.gz already exists however an answer was never provided.
Although search for an answer I can't seem to find a solution for this problem and was hoping if someone here could point me in the right directlion.
We are running our Tomcat 8 servers on Tomcat8 servers on Ubuntu 16.04.1 LTS.
Kind Regards.
- find /var/log/$NAME/ -name \*.$LOGEXT -daystart -mtime +0 -print0 \ + find /var/log/$NAME/ -name \*[0-9].$LOGEXT -daystart -mtime +0 -print0 \
log4j adds date suffix to log files names on rotation, so there must be a digit there so just add this digit to glob in
/etc/cron.daily/tomcat8