Ubuntu 14.04 provides log rotating for Tomcat 7 and assumes log files named by day, so it searches for those and existing ones are compressed and deleted. Depending on if log files exist and how often those are changed, this might clash with the monthly naming scheme my own web applications hosted by Tomcat 7 are using:
/etc/cron.daily/tomcat7:
gzip: /var/log/tomcat7/…/RebootDevice/2017-05.log.gz already exists; not overwritten
I can live with those messages being sent every few days or weeks, because the log messages by default only contain errors and those shouldn't occur too often. The thing that I don't understand is why I get this message the second day already. Ubuntu does the following:
find /var/log/$NAME/ -name \*.$LOGEXT -daystart -mtime +0 -print0
I've tested that on my actual directories with the following results:
root@…:/var/log/tomcat7/…/RebootDevice# ls -lisa
[…]
1089049 0 -rw-r--r-- 1 tomcat7 tomcat7 0 Mai 29 09:09 2017-05.log
1089047 4 -rw-r--r-- 1 tomcat7 adm 402 Mai 26 10:22 2017-05.log.gz
root@…:/var/log/tomcat7/…/RebootDevice# find . -name \*.log -daystart -mtime -0
root@…:/var/log/tomcat7/…/RebootDevice# find . -name \*.log -daystart -mtime +0
./2017-05.log
As you can see, the invocation using +0 finds my file even if it was last written two days ago, while using -0 doesn't. -mtime is defined as n*24 hours, so +/-0 shouldn't make any difference and from my understanding -daystart is anchoring the tests to the beginning of a full day only, should be 00:00.
So why does -0 vs. +0 behave differently in this case? It seems to make a difference of 1*24 hours.