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.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • acidsolution Mar 17, 2010 @ 11:12

    This is not the fix.
    it doesnot help if your vnstat cron file is being generated every minutes and your umask setting is not 022 .
    What if i have umask as 002 and by vnstat file is being written every min by some other process.

  • af Oct 22, 2012 @ 16:44

    my files was with rw permission, after changed the file to r only,
    cron, start worked perfectly
    Cheers for that, this has fixed my problem ;)

    Antonio Feijao

  • pan Jun 13, 2013 @ 7:27

    Thanks for the post. This solution worked well for me :D

    • naveen Dec 9, 2014 @ 10:22

      chmod 0644 /etc/crontab will also work.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum