paddyfitz2005
asked on
cron job: permission denied
hi
I'm having a problem running a cron job on my web hosing server
this is my script to run a java program
java -cp "appservers/jakarta-tomcat -5.5x/weba pps/DBTest /WEB-INF/c lasses" Updater
but i get the following error
/bin/sh: line 1: /usr/ngasi/contexts/paddyf itz/script 2.sh: Permission denied
Any Ideas
I'm having a problem running a cron job on my web hosing server
this is my script to run a java program
java -cp "appservers/jakarta-tomcat
but i get the following error
/bin/sh: line 1: /usr/ngasi/contexts/paddyf
Any Ideas
ASKER
this is all i have in my script!
java -cp "appservers/jakarta-tomcat -5.5x/weba pps/DBTest /WEB-INF/c lasses" Updater
I'm new to crons and i know i have to define the java home dir but i can't find it on my web hosting server
java -cp "appservers/jakarta-tomcat
I'm new to crons and i know i have to define the java home dir but i can't find it on my web hosting server
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok that makes sense nut i'm not sure what you mean by
>>replace java with whatever you system returns with the "which java" command (no "").
>>replace java with whatever you system returns with the "which java" command (no "").
you need the full path for the java program probably something like:
/usr/local/jdk/bin/java
if you type in
which java
it will give you the full path
/usr/local/jdk/bin/java
if you type in
which java
it will give you the full path
paddyfitz2005,
1) add #!/bin/sh as a first line of your script
2) give your script execution priveledges:
chmod +x /usr/ngasi/contexts/paddyf itz/script 2.sh
this should help.
1) add #!/bin/sh as a first line of your script
2) give your script execution priveledges:
chmod +x /usr/ngasi/contexts/paddyf
this should help.
logon as "root" and do what ever the cron works.
It looks like whatever happens on line one of script2.sh is causing the problem. Can you post the first few lines of that script?
Also I always use fully qualified paths in the crontab since cron runs with a limited environment.