Crontab Related problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab Related problem
# 1  
Old 09-13-2006
Crontab Related problem

Hi

Following is the script which runs from command prompt....... but when I schedule it in crontab , its showing some error ( mentioned after this piece of code)

Code:
#!/bin/ksh

PATH=/usr/bin:/usr/ucb:/etc:.
export PATH

JAVA_HOME=/opt/bea/jdk131; export JAVA_HOME
ANT_HOME=/opt/bea/ant
_ANT_HOME=$ANT_HOME; export _ANT_HOME

 _ANT_JAR=$_ANT_HOME/lib/ant.jar; export _ANT_JAR
_XML_APIS_JAR=$_ANT_HOME/lib/xml-apis.jar

_CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
_CLASSPATH=$_CLASSPATH:$JAVA_HOME/lib/classes.zip
_CLASSPATH=$_ANT_JAR:$_XML_APIS_JAR:$_PARSER_JAR:$_CLASSPATH; export _CLASSPATH


java -mx64m -Dant.home=$ANT_HOME -classpath $_CLASSPATH org.apache.tools.ant.Main -verbose -buildfile /opt/bea/wls61/config/d
ev05/batch_automation/MBPSBatch/scripts/build.xml   > /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/logs/ant.log
2>&1

grep -i "BUILD FAILED" /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/logs/ant.log  2>/dev/null
rcode=$? ############save the return code here if Failed found it would be 0
echo "$rcode"
if [ $rcode -ne 0 ]
then
echo "No failed found run the script abc.sh"
. /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/startMassTransfer.sh
else
echo "Failed encounter ..."
mailx -s "[`date`] Failure: Error in script" edhfjh@dsjg.com < /opt/bea/wls61/config/dev05/batch_automation/Mass
Transfer/logs/ant.log
echo "Error was encountered in your script" | mailx -s "ALERT!!" dshfgg@gmail.com
fi


**********************
Following is the error that is encountered when it is run using crontab.


Claims_schema:
      [sql] connecting to jdbc:oracle:thin:@114.14.15.125:1521:PLMDEV
      [sql] Loading oracle.jdbc.driver.OracleDriver using system loader.

BUILD FAILED
file:/opt/bea/wls61/config/dev05/batch_automation/MBPSBatch/scripts/build.xml:40
: Class Not Found: JDBC driver oracle.jdbc.driver.OracleDriver could not be loaded
        at org.apache.tools.ant.taskdefs.JDBCTask.getDriver(JDBCTask.java:403)
        at org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java:342)
        at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
        at org.apache.tools.ant.Task.perform(Task.java:319)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 1 second

Please suggest needful

Thanks

Pankaj
# 2  
Old 09-18-2006
Your main problem is:

Code:
: Class Not Found: JDBC driver oracle.jdbc.driver.OracleDriver could not be loaded

You need to make sure that this is referenced in the environmental variables, at the moment it cannot find it and thus cannot build it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab problem

Hi One shell script is running fine when I am running it through command line. However the same thing is not working when I am trying through cron. Basically when I debugged I found when I am running it throuh ssh terminal ( putty) it's getting loading the profile file properly but... (7 Replies)
Discussion started by: Anupam_Halder
7 Replies

2. Shell Programming and Scripting

need downloading related help...but its not related to unix

Hi All, I am trying to dowmload the zip file "zkManageCustomers.zip " but i dont have access. Can anyone help me to download this file See the below link- http://www.ibm.com/developerworks/opensource/library/wa-aj-open/index.html?ca=drs- Please help me as early as... (1 Reply)
Discussion started by: aish11
1 Replies

3. Solaris

Problem to understand METADEVICE and related commands

Hi everyone, I'm new with solaris administration. I have just discovered the notion of METADEVICE and I really don't understand it. Can any one please explain it to me or give me useful link ? I also want to know more about these commandes: metainit metadb metaattach Thank you ... (1 Reply)
Discussion started by: adilyos
1 Replies

4. Solaris

Crontab Problem

Dear All I have machine with SunOS APP5a 5.9 Generic_122300-19 sun4u sparc SUNW,Sun-Fire With crontab like this : 59 23 * * * /home/lng/script/move_and_compress_logs_update.sh But that crontab cannot running at that time. I run my script by manually, the result is fine. What must I check at... (5 Replies)
Discussion started by: mbah_jiman
5 Replies

5. Shell Programming and Scripting

Problem related to shell script

I am new in shell script.I want to write a shell script to read username and password from file and compare it with the username and password which is entered by the GUI application. (1 Reply)
Discussion started by: shubhig15
1 Replies

6. Programming

and again, socket() related problem...

Dear All, I've searched many topics and googled many web-pages, but still I didn't found solution to this problem. I want to set timeout for connect(). The thing is, that my code works only on BSD, on Linux (tested on SuSE box) it freezes at connect() call :( bool SomeFunc(std::string... (1 Reply)
Discussion started by: sggkxv
1 Replies

7. Solaris

Hardware Raid related problem

Dear All I would Like to know that if suppose c1t0d0 is of 72 gb hard disk and system boot from this hard disk and c1t1d0 is of 147gb hard disk. Can we implement hardware raid (Mirror) between these two hard disks of different capacity if raid crontroller is present in the server Kind regards (4 Replies)
Discussion started by: girish.batra
4 Replies

8. UNIX for Advanced & Expert Users

DOS messaging question - related to UNIX process problem

Hi, This is a strange request. I know there is some sort of crude DOS tool that allows you to communicate to another PC either using its IP adress or PC name. But I can't remember where aor what its called, any ideas? Reason for asking here, Someone has telnet'd on a UNIX server I have... (0 Replies)
Discussion started by: nhatch
0 Replies

9. Shell Programming and Scripting

what is problem with this small shell script.. case statement related

Hi All, this small script is written to recognize user input character.. it is in small case .. upeer case or is a number... but when i input first capital letter say A.. it always gives small character.... what is the problem. #!/bin/bash echo "Enter the character" read a case $a in )... (2 Replies)
Discussion started by: johnray31
2 Replies

10. UNIX for Dummies Questions & Answers

Problem related to awk

Hi, can anyone explain me the following command. awk '{y=x "\n" $0; x=$0};END{print y}' file_name Regards Rochit (2 Replies)
Discussion started by: rochitsharma
2 Replies
Login or Register to Ask a Question