Shell script does not work on cron
15 pts.
0
Q:
Shell script does not work on cron
I created a shell script which runs fine from the command line but does not get executed when I added to crontab.
I have checked the environmental PATH and added the path to my script to it I also specified the absolute path in the crontab entry.
I have scheduled different tasks using the crontab before and they run fine according to the specified schedule. I know that neither the crontab entry nor the environmental variable PATH is an issue but I am not quite sure what else should I look for. Any tip would be greatly appreciated. Thanks.
ASKED: Aug 16 2008  1:31 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
265 pts.
0
A:
 RATE THIS ANSWER
-1
Click to Vote:
  •   0
  •  -1
  • AddThis Social Bookmark Button
This is most likely caused by output from the script. Try appending > /dev/null to the end of the line in cron that runs
the script.

hth
Last Answered: Aug 18 2008  6:30 PM GMT by Xjlittle   265 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Oga   15 pts.  |   Aug 20 2008  12:56PM GMT

Thank you Xjlittle,
I found that the script has executed fine via cron and produced the output file and only failed the last step (send an e-mail). I had the last step to send an e-mail to a remote mail server and it seems like the connection was timing out and it wasn’t retrying to re-send it later. I fixed it by creating an alias.

 
0