Shell script does not work on cron

15 pts.
Tags:
Crontab
Scripts
Shell scripts
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: August 16, 2008  1:31 PM
UPDATED: August 20, 2008  12:56 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Oga
    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.
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following