Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cron not running

Status
Not open for further replies.

m2001331

Technical User
May 29, 2002
73
0
0
MY
dear all,

i have set a cronjob line below in crontab under one of the admin users - who also owns the file CleanData.sh,I expect it to run every hour,however the cron is not running.
I can execute CleanData.sh manually and it runs well.
please advice.i don't know where i went wrong.
please help.

# cron to clear
0 * * * * /klush/CleanData.sh

thanks.
 
Make sure the appropriate PATH variable is set in the script, you can check this if you type echo $PATH in the environment you run the job interactively, and then use the same in your script, as one (if not the) first commands.
 
Hi...
I have no problem running the script manually - i just cannot get the cron to run.
so i figure that the script contains the correct path -
i have set the cron to run hourly .
thanks
 
Hi below is the error message i received in mail for user oadm. i don't understand why it says CleanData.sh[9] when the crontab entry is like:-
0 * * * * /klush/CleanData.sh

and the sh file CleanData.sh is located in folder klush - when i pwd the return is /klush/CleanData.sh.

Mail message.
Message 1:
From daemon Sat Jul 3 09:30:00 2004
Date: Sat, 3 Jul 2004 09:30:00 -0400
From: daemon
To: oadm

/klush/CleanData.sh[9]: java: not found.


*****************************************************************
cron: The previous message is the standard output
and standard error of one of the cron commands.

please advise.
cron newbie.
thanks
 

As KenCunningham says you need to set the environment variables in the script.

Cheers
 
thanks.it works after setting the PATH.
thanks.
 
For future reference, the [9] meant that the error occurred on the ninth line of the script.

Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top