Overview
This article provides troubleshooting steps you can take to resolve any issues with your cron jobs.
Troubleshooting error messages
Most issues can be resolved by adding an email address, configuring permissions, and specifying the full file path.
Set an email address
When testing your new cron job, make sure to set an email address for reporting the results. This gives you important information about what may be going wrong if the command line is not running the cron job as desired.
You will only receive an email if the cron fails, or if the cron job itself creates output to view.
Error: Could not open input file
You may receive an email with this text when the cron job fails to run. Check the subject of the email that was sent to you. It will start like this: Cron username@server
Check the username
-
Make a note of this username, then check the cron job you created in the panel. These should be the same username. If the username is different than what you see in the panel, make sure to adjust your cron job to the correct username.
Check the permissions
-
Confirm the file permissions are set so the user may run it. This usually means 644 permissions for a file and 755 for a directory.
Error: No such file or directory
Try adding the full path to the file you're attempting to run as well as the full path to any file's you're writing to. For example, instead of:
cat file.txt
Change to:
cat /home/username/example.com/file.txt
Dedicated Server troubleshooting
It's rare that the cron service on a server may stop running. However, if you’re using a Dedicated Server, you can verify the cron is running by running this shell command:
[server]$ ps aux | grep cron
You can also check the system log for entries labeled 'CRON' after changing to your admin user and running the following commands.
[server]$ sudo su - [root]# sudo grep CRON /var/log/syslog
If you don’t see any recent CRON entries then you may want to restart the cron service. To restart cron run this command under your Dedicated Server's admin user:
[root]# sudo service cron restart