If you are looking for software to use, go to Huajun Software Park! software release

What should I do if the BAD FILE MODE error occurs in Linux crontab?

Author: monster Date: 2017-05-05

Ubuntu For Linux
Ubuntu For Linux-14.10

operating system Storage: 1158720KB Time: 2014-04-22

Software Introduction: Ubuntu is a freely distributed and open source Linux-based operating system designed for humans, humans who have no previous experience with Linux...

Download now

The crontab command is mainly used to set instructions to be executed periodically, but sometimes an exception occurs in the crontab, no instructions are automatically executed, and a BAD FILE MODE error message appears. How to solve this situation? This article mainly introduces the solution to the Linux crontab error: BAD FILE MODE. The system environment is RHEL. Friends in need can refer to it.

53-14121Q15945357.jpg

I encountered a problem recently. After the server went online, crontab encountered exceptions and did not execute automatically. After checking the log, I found the problem:

The code is as follows:

Apr 16 11:26:01 jb51.net crond[28354]: (*system*) BAD FILE MODE (/etc/cron.d/flushhost)

Apr 16 11:26:01 jb51.net crond[28354]: (root) BAD FILE MODE (cron/root)

I checked other files in the /etc/cron.d/ directory and found that the flushhost attribute was 755 and the others were 644, so I changed the script attribute to 644 and the problem was solved.

In addition, the install.sh script of the mysql installation package was also modified. After the new server was installed, the attribute of the flushhost script was modified to 644.

This problem seems to have only been encountered under certain versions of RHEL, not all versions.

The above is the solution to the Linux crontab error BAD FILE MODE summarized by the editor. If your crontab does not execute automatically and the error message appears in the log, you can use this method to solve it.

Related articles