title: Cron BAD FILE MODE vs permission denied
body: <p>I have a <code>cron</code> job for backuping my databases:</p>
  
  <pre><code>➜  ~ crontab -l
  @daily /etc/cron.d/pg_backup.sh
  </code></pre>
  
  <p>There is a problem with setting appropriate permissions, though.</p>
  
  <p>When I have:</p>
  
  <pre><code>➜  ~ ls -l /etc/cron.d/pg_backup.sh
  -rwxr-xr--. 1 root root 1359 Apr 14 21:39 /etc/cron.d/pg_backup.sh
  </code></pre>
  
  <p>and then check <code>grep "pg_backup.sh" /var/log/cron</code>, I see:</p>
  
  <pre><code>localhost crond[11881]: (root) BAD FILE MODE (/etc/cron.d/pg_backup.sh)
  </code></pre>
  
  <p>However, when I modify <code>pg_backup.sh</code> as:</p>
  
  <pre><code>chmod 644 pg_backup.sh
  </code></pre>
  
  <p>It disables the warning:</p>
  
  <pre><code>localhost CROND[11064]: (root) CMD (/etc/cron.d/pg_backup.sh)
  </code></pre>
  
  <p>but I see</p>
  
  <pre><code>➜  ~ cat /var/mail/root
  # ...
  /bin/sh: /etc/cron.d/pg_backup.sh: Permission denied
  </code></pre>
  
  <p>What are the appropriate file permissions then?</p>