Cron Job fails with Error Message “(getpwnam() failed): No such file or directory”

On a CentOS server, cronjob did not work. Checking the log file found the following error message in /var/log/cron

The error was because no user was specified in the cronjob. When you use cronjob in file /etc/crontab, you need to specify the username before the command in cronhjob.

On the server, I had the following cronjob

To fix the error, I added the user name before the command as below.

See cronjob

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *