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