crond: (*system*) BAD FILE MODE Error and Solution

I‘m getting this message in my /var/log/cron

Mar 12 09:20:01 server2 crond[1267]: (*system*) BAD FILE MODE (/etc/cron.d/vnstat)

How do I fix this problem under Fedora / CentO / RHEL or any Linux distro?

Run an ls -l on /etc/cron.d/vnstat file and find out the permissions. cron do not like files with world writable file and it is pretty picky about it. All you have to do it set 0644 (rw-r–r) permission i.e. remove world writable file permissions. Type the following command as root user:
# ls -l /etc/cron.d/vnstat
# chmod 0644 /etc/cron.d/vnstat
# ls -l /etc/cron.d/vnstat

This should fix the problem.

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.