centos cron logs are not executed
5,797
No such file or directory
can imply a number of things. The two most common cryptic cases are:
- You tried to traverse a broken symlink
- You tried to open a file in a nonexistent directory
Check whether these are the case. It can also happen if your program expects the file to exist when opened and hasn't specified to the operating system that it's OK to create it if it doesn't. You could try something like touch /var/log/cron
so it has something to stat; this command will create an empty file there.
Related videos on Youtube
![fefe](https://i.stack.imgur.com/VN5cW.png?s=256&g=1)
Author by
fefe
Updated on September 18, 2022Comments
-
fefe almost 2 years
I have been trying to setup a cronjob on CentOS but it doesn't seem to work. I have been deleting the cron's logfile to see all newly created logs and I have been restarting crond but
/var/log/conf
wasn't getting recreated?logrotate /etc/logrotate.conf
is showing me an errorerror: stat of /var/log/cron failed: No such file or directory
-
fefe about 11 yearsI have been recreating as @Falcon Momot advised touch /var/log/cron and seems to work now. I'm going to retest my cronjob now
-
Drew Khoury about 11 yearsThis may be a result of the syslog daemon not running. It's possible that the log files were not being created due to the daemon being in a stopped state. After (re)starting the service you may find the file is created for you.