Crontab not recognizing the jar files


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Crontab not recognizing the jar files
# 1  
Old 04-30-2008
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
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

View all jar files contents in one go ?

I can view a jar file contents using the below command: $ jar -tvf ./checker-compat-qual-2.0.0.jar 0 Mon May 02 18:28:46 IST 2016 META-INF/ 184 Mon May 02 18:28:44 IST 2016 META-INF/MANIFEST.MF 0 Mon May 02 17:20:16 IST 2016 afu/ 0 Mon May 02 17:20:16 IST 2016 afu/org/ ... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies

3. Shell Programming and Scripting

Running a script in crontab which executes a jar file

Hi, I have a script (.sh file) which has been created through my login. This script executes a jar file. Java is installed through my login and the folder has been given full permission for access. When this script is added by root in crontab, it does not get executed. Could you please... (1 Reply)
Discussion started by: archana.n
1 Replies

4. Shell Programming and Scripting

Cronjob for recognizing changes and/or new files in specific directory

Hey Guys, is there a way to create a cronjob to watch over all changes in a specific directory, for example /home/user and send them, if there are any changes, to a server:confused: Thanks Sebi0815 (4 Replies)
Discussion started by: Sebi0815
4 Replies

5. Solaris

Differences between jar files

I want to find the difference between two jar files sitting on a sun box. How do I do this? (3 Replies)
Discussion started by: runnerpaul
3 Replies

6. UNIX for Dummies Questions & Answers

How to iteratively copy *.jar files

Hello, I want to copy all *.jar files from a parent tree structure, traversing all sub directories, into the traget dir. What shud be the command for that. I tried below command from the source parent dir cp -r *.jar pathtotargetdir but get the error '*.jar : No such file or... (1 Reply)
Discussion started by: New2
1 Replies

7. UNIX for Dummies Questions & Answers

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 * * * *... (4 Replies)
Discussion started by: rajuutla
4 Replies

8. Linux

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 * * * *... (3 Replies)
Discussion started by: rajuutla
3 Replies

9. UNIX for Advanced & Expert Users

Question regarding the .tar and .jar files

1) What is the comamnd in need to use to find the diff between .tar files. 2) when i unzip the tar file i get .jar files.. the question i have here is i need to find only the modified file list from the .jar file does any one have done, please do share .... Thanks (0 Replies)
Discussion started by: gkrishnag
0 Replies
Login or Register to Ask a Question
java-functions(7)						RPM Java packaging						 java-functions(7)

NAME
java-functions - Functions library for Java applications. Written for the JPackage Project <http://www.jpackage.org/>: SYNOPSIS
set_jvm() Set the java virtual machine. Use a JAVA_HOME if defined, or try to find it from java command set_classpath() Set the classpath - this functions requires a valid JAVA_HOME, JAVACMD, and JAVA_LIBDIR. JARs could be specified as an argument, or via ADDITIONAL_JARS variable. set_javacmd() set the JAVACMD variable. Options should be passed via JAVACMD_OPTS variable. set_flags() set FLAGS variable. They could be specified as an argument, or via ADDITIONAL_FLAGS variable. set_options() set OPTIONS variable. They could be specified as an argument, or via ADDITIONAL_OPTIONS variable. run() run the application. It executed a following command. If VERBOSE is defined, then it prints the command to stdout. exec $JAVACMD $FLAGS -classpath $CLASSPATH $OPTIONS $MAIN_CLASS "$@" set_jvm_dirs() set JVM-related directories (JVM_LIBDIR, JAVA_VERSION, JAVAVER_LIBDIR and JAVAVER_JNIDIR variables). Requires a correct JAVA_LIBDIR, JAVA_HOME and JAVA_CMD. link_jar_repository() links a jar repository. Options could be found in build-jar-repository(1) find_jar() finds a specific extention (jar or directory). Requires a correct JAVA_LIBDIR, JAVAVER_LIBDIR and JVM_LIBDIR. Used by find-jar(1) com- mand. do_find_jar() core routine used by find_jar() check_java_env() checks java environment - the JAVA_HOME, JAVACMD, JAVA_LIBDIR, JNI_LIBDIR variables. DESCRIPTION
This is a library of generic shell functions which should be used on jpackage.org compatible distributions. FILES
/use/share/java-utils/java-functions shell script functions library for Java applications /etc/java/java.conf system-wide Java configuration file ~/.java/java.conf user's Java configuration SEE ALSO
Regular Manual Pages build-jar-repository(1) find-jar(1) java.conf(5) jpackage-utils(7) AUTHORS
Guillaume Rousse <guillomovitch@sourceforge.net> Ville Skytta <scop at jpackage.org> David Walluck <david@jpackage.org> Nicolas Mailhot <Nicolas.Mailhot at laPoste.net> REPORTING BUGS
Report bugs using JPackage Bugzilla (http://www.jpackage.org/bugzilla/) jpackage-utils 1.7.5 February 2009 java-functions(7)