title: I'm stuck on logrotate mystery
body: <p>I have two logrotate files:</p>
  
  <p><strong>/etc/logrotate.d/nginx-size</strong></p>
  
  <pre><code>/var/log/nginx/*.log 
  /var/log/www/nginx/50x.log
  
  {
      missingok
      rotate 3
      size 2G
      dateext
      compress
      compresscmd /usr/bin/bzip2
      compressoptions -6
      compressext .bz2
      uncompresscmd /usr/bin/bunzip2
      notifempty
      create 640 nginx nginx
      sharedscripts
      postrotate
          [ -f /var/run/nginx.pid ] &amp;&amp; kill -USR1 `cat /var/run/nginx.pid`
      endscript
  }
  </code></pre>
  
  <p>and </p>
  
  <p><strong>/etc/logrotate.d/nginx-daily</strong></p>
  
  <pre><code>/var/log/nginx/*.log 
  /var/log/www/nginx/50x.log
  
  {
      missingok
      rotate 3
      dateext
      compress
      compresscmd /usr/bin/bzip2
      compressoptions -6
      compressext .bz2
      uncompresscmd /usr/bin/bunzip2
      notifempty
      create 640 nginx nginx
      sharedscripts
      postrotate
          [ -f /var/run/nginx.pid ] &amp;&amp; kill -USR1 `cat /var/run/nginx.pid`
      endscript
  }
  </code></pre>
  
  <p>Command <code>logrotate -d -v /etc/logrotate.d/nginx-size</code>output:</p>
  
  <pre><code>reading config file /etc/logrotate.d/nginx-size
  compress_prog is now /usr/bin/bzip2
  compress_options is now  -6
  compress_ext is now .bz2
  uncompress_prog is now /usr/bin/bunzip2
  
  Handling 1 logs
  
  rotating pattern: /var/log/nginx/*.log 
  /var/log/www/nginx/50x.log
  
   2147483648 bytes (3 rotations)
  empty log files are not rotated, old logs are removed
  considering log /var/log/nginx/access.log
    log does not need rotating
  considering log /var/log/nginx/error.log
    log does not need rotating
  considering log /var/log/nginx/get.access.log
    log does not need rotating
  considering log /var/log/nginx/post.access.log
    log needs rotating
  considering log /var/log/www/nginx/50x.log
    log does not need rotating
  rotating log /var/log/nginx/post.access.log, log-&gt;rotateCount is 3
  dateext suffix '-20141204'
  glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
  glob finding old rotated logs failed
  renaming /var/log/nginx/post.access.log to /var/log/nginx/post.access.log-20141204
  creating new /var/log/nginx/post.access.log mode = 0640 uid = 497 gid = 497
  running postrotate script
  running script with arg /var/log/nginx/*.log 
  /var/log/www/nginx/50x.log
  
  : "
          [ -f /var/run/nginx.pid ] &amp;&amp; kill -USR1 `cat /var/run/nginx.pid`
  "
  compressing log with: /usr/bin/bzip2
  </code></pre>
  
  <p>Same (normal) output on ngnix-daily..</p>
  
  <p>If I run from root command </p>
  
  <pre><code>logrotate -f /etc/logrotate.d/nginx-size 
  </code></pre>
  
  <p>manually, it do all the thing. BUT! It don't run it automatically!</p>
  
  <p>contab:</p>
  
  <pre><code>*/5 5-23 * * * root logrotate -f -v /etc/logrotate.d/nginx-size 2&gt;&amp;1 &gt; /tmp/logrotate_size   
  00 04 * * * root logrotate -f -v /etc/logrotate.d/nginx-daily 2&gt;&amp;1 &gt; /tmp/logrotate_daily
  </code></pre>
  
  <p>Also, files /tmp/logrotate_daily &amp; /tmp/logrotate_size are always empty..</p>
  
  <p>Cron don't give me any errors in /var/log/cron</p>
  
  <pre><code>Dec  4 14:45:01 (root) CMD (logrotate -f -v /etc/logrotate.d/nginx-rz-size 2&gt;&amp;1 &gt; /tmp/logrotate_size   )
  Dec  4 14:50:01 (root) CMD (logrotate -f -v /etc/logrotate.d/nginx-rz-size 2&gt;&amp;1 &gt; /tmp/logrotate_size   )
  </code></pre>
  
  <p>What's wrong with dat thing?.. Centos 6.5 x86_64, Logrotate version 3.8.7 (out of source) + logrotate version 3.7.8 (via rpm).</p>
  
  <p>Thx in advance. </p>