title: logrotate cron job not rotating certain logs
body: <p>I added two scripts in "logrotate.d" directory for my application logs to be rotated.
  This is the config for one of them:</p>
  
  <pre><code>&lt;myLogFilePath&gt; {
    compress
    copytruncate
    delaycompress
    dateext
    missingok
    notifempty
    daily
    rotate 30
  }
  </code></pre>
  
  <p>There is a "logrotate" script in "cron.daily" directory (which seems to be running daily as per cron logs):</p>
  
  <pre><code>#!/bin/sh
  
  echo "logrotate_test" &gt;&gt;/tmp/logrotate_test
  #/usr/sbin/logrotate /etc/logrotate.conf &gt;/dev/null 2&gt;&amp;1
  /usr/sbin/logrotate -v /etc/logrotate.conf &amp;&gt;&gt;/root/logrotate_error
  
  EXITVALUE=$?
  if [ $EXITVALUE != 0 ]; then
      /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
  fi
  exit 0
  </code></pre>
  
  <p>The first echo statement is working.<br />
  <strong>But I find my application logs alone are not getting rotated, whereas other logs like httpd are getting rotated ** <br />
  **And I also don't see any output in the mentioned "logrotate_error" file</strong> (has write permission for all users).</p>
  
  <p>However the syslog says: <strong>"logrotate: ALERT exited abnormally with [1]"</strong></p>
  
  <p>But when I run the same "logrotate" in "cron.daily" script manually, everything seems working fine.</p>
  
  <p>Why is it not rotating during daily cron schedule? Am I doing something wrong here? <br />
  It would be great if I get this much needed help.</p>
  
  <p><strong>UPDATED:</strong>
  It looks like, it's because of selinux - the log files in my user home directory has restrictions imposed by selinux and the when logrotate script is run:</p>
  
  <pre><code>SELinux is preventing /usr/sbin/logrotate from getattr access on the file /home/user/logs/application.log
  </code></pre>