title: Logrotate daily+maxsize is not rotating
body: <p>I've CentOS 7.4 with logrotate 3.8.6 installed. I've a custom logrotate file under <code>/etc/logrotate.d/</code> to rotate some logs on a Tomcat (e.g., catalina.out) which is installed in the same machine.</p>
  
  <pre><code>/opt/test/apache-tomcat-8.5.15-client/logs/catalina.out {
      copytruncate
      daily
      rotate 30 
      olddir /opt/test/apache-tomcat-8.5.15-client/logs/backup
      compress
      missingok
      maxsize 50M
      dateext
      dateformat .%Y-%m-%d
  }
  </code></pre>
  
  <p>I want the log to be rotated daily or if the size reaches 50MB. When this happens log files are compressed and copied into a backup folder and are kept for 30 days before being deleted. </p>
  
  <p>I already ran logrotate manually in debug mode with the following command and no errors were displayed (and the expected zipped log files were created):</p>
  
  <p><code>/usr/sbin/logrotate -d /etc/logrotate.d/openncp-tomcat-backoffice 2&gt; /tmp/logrotate.debug</code></p>
  
  <p>In <code>/var/lib/logrotate/logrotate.status</code> there are no issues, the files are shown as rotated but they're not in fact:</p>
  
  
  
  <pre><code>"/var/log/yum.log" 2017-11-27-19:0:0
  "/opt/test/apache-tomcat-8.5.15-server/logs/catalina.out" 2017-12-15-3:41:1
  "/var/log/boot.log" 2017-12-15-3:41:1
  "/var/log/up2date" 2017-11-27-19:0:0
  </code></pre>
  
  <p>I've the default <code>/etc/logrotate.conf</code>:</p>
  
  
  
  <pre><code># see "man logrotate" for details
  # rotate log files weekly
  weekly
  
  # keep 4 weeks worth of backlogs
  rotate 4
  
  # create new (empty) log files after rotating old ones
  create
  
  # use date as a suffix of the rotated file
  dateext
  
  # uncomment this if you want your log files compressed
  #compress
  
  # RPM packages drop log rotation information into this directory
  include /etc/logrotate.d
  
  # no packages own wtmp and btmp -- we'll rotate them here
  /var/log/wtmp {
      monthly
      create 0664 root utmp
          minsize 1M
      rotate 1
  }
  
  /var/log/btmp {
      missingok
      monthly
      create 0600 root utmp
      rotate 1
  }
  
  # system-specific logs may be also be configured here.
  </code></pre>
  
  <p>I also have the default <code>/etc/cron.daily/logrotate</code>:</p>
  
  
  
  <pre><code>#!/bin/sh
  
  /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
  EXITVALUE=$?
  if [ $EXITVALUE != 0 ]; then
      /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
  fi
  exit 0
  </code></pre>
  
  <p>I ask for your guidance on configuring this appropriately. </p>