![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Crontab not recognizing the jar files | rajuutla | Linux | 3 | 05-01-2008 05:27 AM |
| Crontab not recognizing the jar files | rajuutla | UNIX for Advanced & Expert Users | 0 | 04-30-2008 03:39 AM |
| Can crontab execute binary files? | Tris | UNIX for Dummies Questions & Answers | 5 | 12-07-2006 10:16 AM |
| recognizing *.* in find | amarnath | Shell Programming and Scripting | 3 | 07-17-2006 03:24 AM |
| recognizing * character | csejl | Shell Programming and Scripting | 3 | 11-15-2005 10:55 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All,
I am using crontab which execute a shell script. In the shell script, I am executing a java program. This Java program requires the jar files. The cron job file ' cronfile.txt ' contents: MAILTO="raju_utla@dcis.uohyd.ernet.in" 0-59 * * * * ./cronfile.sh >> /home/rajuutla/FilesForCronJob/logFileForCron.log The shell script( cronfile.sh ) contents : #!/bin/bash #check weather server prog is running or not test=`ps aux | grep -c java\ PostgresServer` JAVA_HOME=/opt/SDK/jdk CLASSPATH=/home/rajuutla/pg74.jdbc3.jar:. if [ $test -eq 1 ] then echo `date` $JAVA_HOME/bin/java -classpath $CLASSPATH PostgresServer fi The java program 'PostgresServer' which i am executing requires the jar file 'pg74.jdbc3.jar' mentioned above. The problem is, directly running the above shell script with out cron, I am able to get the results. But when I use the crontab to run the java program I am not able to get the results. What may be the problem? How to resolve this problem? I am unable to find it out. Please help me. Thanks to All. Raju |
| Forum Sponsor | ||
|
|
|
||||
|
Not entirely sure if it will help, but have you tried to export CLASSPATH ...
ie: export CLASSPATH=/home/rajuutla/pg74.jdbc3.jar:. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Later: ... I do apologise, this is the second night in a row I've logged on and not read posts correctly. Thank god I'm headed away for the weekend. If you did a search of the forums, you'd find your answer ... The UNIX Forums - Search Forums And please stop creating multiple posts. Last edited by Cameron; 05-01-2008 at 04:35 AM. |
|
|||
|
is that a real mail id ? if so, please remove that or provide a fake one
problem with the question - able to run in shell but not in cron is attributed greatly to the environment variables that are needed to run a process which are available via shell automatically or set as a one time configuration. But that might not be the case when run via cron, explicitly provide all the needed environment variables needed to run the process |