Here are some very common crontab issues that users often have.
1. First, make sure that the command you are trying to use runs without error from the command line. If it doesn’t run from the command line it will not run from cron either.
2. Make sure you use the full path to all programs. The environment inside of crontab is different than the shell. You almost always need to give full paths to everything.
As an example, if you want to use wget :
*/30 * * * * wget http://my-domain.com/some_page.php
and not just
The correct line would look like :
*/30 * * * * /usr/bin/wget http://my-domain.com/some_page.php
This also goes for all file path names. Make sure you give the full path such as :
3. You may also want to add:
to the top of the crontab to make sure it is mailing you an errors that are generated. This will make it much easier to debug any problems you are having.
Try to add a simple crontab like:
* * * * * /bin/touch /home/your_home_directory_here/cron_test.txt
this should update the time stamp on the file crontest.txt each minute.
Don’t forget to delete this test crontab after you have made sure it is running correctly.
Yes, to have the output of your crontab mailed to you, type:
as the first line of the crontab and all output will go to the address you provide.
Is the command “at” available for me to use? When i issued an at command, i got the following message:
Can’t open /var/run/atd.pid to signal atd. No atd running?
To keep servers running as fast as possible, we no longer offer atd service. While Atd is not a large drain on system resources we try to keep as few non-critical processes running as possible. We do offer crond. Cron can replicate (and goes beyond) most of atd’s functionality.
You can edit your crontab with the command :
from inside of ssh.
We offer standard unix crontab. No special setup is required. All accounts have crontab enabled by default.
You can login via the shell and type:
to edit your crontab.
If you have your desired crontab commands in a text file, login to ssh and type :
and it will reset your crontab to use those commands.
Any standard tutorial on crontab will be applicable to our configuration.