The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab not recognizing the jar files rajuutla UNIX for Dummies Questions & Answers 4 05-01-2008 11:20 PM
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-2008
Registered User
 

Join Date: Apr 2008
Posts: 5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Question Crontab not recognizing the jar files

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
  #2 (permalink)  
Old 04-30-2008
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 719
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
mention absolute path instead of this:
Code:
./cronfile.sh
if that doesn't solve your problem, try searching here
  #3 (permalink)  
Old 05-01-2008
Registered User
 

Join Date: Apr 2008
Posts: 5
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
I added the absolute path to './cronfile.sh' as
'/home/rajuutla/cronfile.sh'. Now also the same problem not recognizing the jar file.

Thanks to All,
Raju
  #4 (permalink)  
Old 05-01-2008
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 719
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
proceed here
Google UNIX.COM
Closed Thread



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 08:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102