PDA

View Full Version : Crontab not working



lukegt
12-22-2003, 10:58 AM
Greetings,

I've setup a crontab to run 2 different update scripts, however they are not executed. is there a way i can check to see if they were executed or not?

0 7 * * 1 /www/aplusteam/mls_updater/mls_update.pl
0 8 * * 1,2,3,4,5,6 /www/aplusteam/mls_updater/mls_update_daily.pl

wildjokerdesign
12-22-2003, 11:28 AM
Ok I think I may have found a link that may help. http://www.aota.net/Script_Installation_Tips/cronhelp.php4 The specifics have to do with diffrent hosting system but the basics are there.

The one thing I picked up from it is that you can't simply create a corntab file and upload it or add to an existing. Once you have created one and uploaded it then you need to telenet into the account and type.

corntab /pathto/cronfile.txt
Here is a quote from that page:

The above tells the server's crontab where the file is located and that you wish to make it active. Make sure the path to the file is the actual path to where the file was placed. If successful you will be returned to the command bash line, if not an error will be displayed)


Does that help?

wildjokerdesign
12-22-2003, 11:41 AM
Something else that is mentioned in that link is that you need a return at the end of the last job you have in the corn file.

wildjokerdesign
12-22-2003, 12:03 PM
Just found some more info on this in the forum. Bevan of WestHost stated that instead of crontab -e to edit the corn file you need to use editcron -e at the ssh command prompt. I am going to go check it out and also see if the logic follows for crontab -l that you would maybe use listcorn -l

UPDATE Nope listcron -l does not work but the editcron -e does.

torrin
12-22-2003, 01:40 PM
I've setup a crontab to run 2 different update scripts, however they are not executed. is there a way i can check to see if they were executed or not?

I would put some kind of an echo or print statement in the script. All output from cron should be sent to you by E-mail.

lukegt
12-22-2003, 05:57 PM
Thanks wildjokerdesign, i wnt through that help section. However i'm not sure how to make it so that it will actually email me once cron runs that specific script. I dont have this program mailto. Is there a way around it?

wildjokerdesign
12-22-2003, 07:25 PM
Did some searching on the web and found this
http://mkaz.com/reference/unix_cron.html
On that page it says that output from a script should be mailed to users e-mail account. It also mentions that this can be set by the cron job by adding this to the cron file.
MAILTO="whatever@mydomain.com"

This leads me to believe that MAILTO is part of cron.