error in running shell script in cron


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error in running shell script in cron
# 1  
Old 04-15-2008
error in running shell script in cron

#!/bin/bash

CLASSPATH=.
#CLASSPATH=${CLASSPATH}:${INSTALL_PATH}home/squidlog/CopyFile.java
CLASSPATH=${CLASSPATH}:${INSTALL_PATH}usr/java/latest/lib/*.jar

javac CopyFile.java


echo "CLASSPATH=$CLASSPATH"

#home/wbiadmin/JRE1.4.2/j2re1.4.2_15/bin/java CopyFile
/usr/bin/java CopyFile




i tried setting classpath still i have problem
# 2  
Old 04-15-2008
this: *.jar

is not a valid entry in the CLASSPATH - CLASSPATH should just a colon delimited set of string - all of which are directories.
# 3  
Old 04-16-2008
setting classpath

plz send me the code for how to write classpath in linu
# 4  
Old 04-16-2008
What jim said; you need to omit the "*.jar" part. Also to be on the safe side, add export CLASSPATH
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Troubles running DB2 command in shell script via cron

Hi there, Now I'm facing error regarding running shell script via cron. The shell script which is required to get value from database. Below is the main part of shell script. #/bin/bash #connect to database(1) db2 connect to $database user xxxx using yyyy #set values from... (3 Replies)
Discussion started by: Rohan Kishibe
3 Replies

2. UNIX for Dummies Questions & Answers

Error while running a script through cron job

Hi Team, When i am running the below query manually it is giving me the right output i.e. export PATH=/usr/sbin:/usr/bin:/sbin:/bin:$PATH ADMIN=abc@abc.com CPU_HIGH=`sar|awk '{print $9}'|sort -n|head -5|sed -n 5p` CPU_MAX=`echo "scale=3; 100-$CPU_HIGH" | bc` CPU_LOW=`sar|awk '{print... (13 Replies)
Discussion started by: Ekamjot
13 Replies

3. Programming

error in running script in cron tab

Hi I am running the following script in cron tab: #!/usr/local/bin/php <?php $handle=fopen('xmlfile.xml',"w"); $xmlfile= file_get_contents('http://diur-plus.2me.co.il/xml.aspx'); fwrite($handle,$xmlfile); fclose($handle); /* * To change this template, choose Tools |... (1 Reply)
Discussion started by: programAngel
1 Replies

4. Shell Programming and Scripting

Running shell script via cron

Hi Guys, I do have a shell script that I scheduled to run via the cron but when the script don't run. But when I run the script manually it does run perfectly... What might be the problem? Thanks. (1 Reply)
Discussion started by: Phuti
1 Replies

5. Shell Programming and Scripting

Running Shell Script in the cron, background process

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (9 Replies)
Discussion started by: blacksteel1988
9 Replies

6. Shell Programming and Scripting

Running Shell Script in the cron, background proccess

Hi, i was looking for an answer for some trouble im having runing a script in the cron, thing is, that when i run it manually it works just fine. But when cron runs it, it just doenst work. I saw a reply on a similar subject, suggesting that the . .profile worked for you, but im kind of... (0 Replies)
Discussion started by: blacksteel1988
0 Replies

7. Solaris

Shell Script gives error when run through cron job.

Hi, The following shell script runs without any problem when executed manulally. USED=$(df -h /arch | tail -1 | awk '{print $5}' | cut -d '%' -f 1) if then find /arch/AUBUAT/ -type f -mtime +0 | xargs rm find /arch/AUBMIG/ -type f -mtime +0 | xargs rm fi But the same gives below... (6 Replies)
Discussion started by: ksadiq79
6 Replies

8. Shell Programming and Scripting

URGENT: cron job not running the sqlplus command in shell script

cron job not running the sqlplus command in shell script but the shell script works fine from command line.. Cronjob: 5 * * * * /home/dreg/script.sh script.sh: #!/bin/ksh /oracle/u000/app/oracle/product/10204/GEN/bin/sqlplus -s <user>/<pass>@<sid/home/dreg/sqlscript.sh ... (18 Replies)
Discussion started by: Ikea
18 Replies

9. UNIX for Dummies Questions & Answers

Error while running the script through cron jobs .Please help me on this

Hi Everyone, I have written a korn shell script to shutdown my documentum docbase server and to restart it automatically on a weekly basis. My script is, When i execute this script manually, i was able to execute it successfully without any issues. I have scheduled this script in cronjob... (1 Reply)
Discussion started by: Sheethal
1 Replies

10. Shell Programming and Scripting

Running a shell script in cron...email not sending - help??

I am pretty new to Unix shell scripting, but wondered if anyone could help (in layman's terms if possible!!) :) I have a shell script which ultimately sends an alert to an email address if part of a batch of programs fails. Here's the script that sends the email: Script: 6check.csh... (8 Replies)
Discussion started by: tjhorwood
8 Replies
Login or Register to Ask a Question