Cron Issue

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Cron Issue
# 8  
Old 08-10-2010
check the cron settings for mail
Code:
# cat /etc/crontab |grep MAIL

and try
Code:
/usr/bin/java

instead of java

Last edited by ygemici; 08-10-2010 at 03:33 PM..
# 9  
Old 08-10-2010
Code:
SHELL=/bin/bash
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/data1/baminstall:/home/Admin/bin
HOME=/root

*/2 * * * *  /opt/data1/BAM/utils/backup.sh
*/13 * * * * /opt/data1/BAM/utils/transfer.sh

I think it's all.
# 10  
Old 08-10-2010
Okay, thank you for all the suggestions here guys. I did a bit more logging on this and here is what it is spitting out at me:

Exception in thread "main" java.lang.NoClassDefFoundError: /opt/data1/BAM/utils/backup/sh
Caused by: java.lang.ClassNotFoundException: .opt.data1.BAM.utils.backup.sh
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: /opt/data1/BAM/utils/backup.sh. Program will exit.

Any ideas what this could be?

Thanks!
# 11  
Old 08-10-2010
URLclassloader? Is it trying to load /opt/data1/BAM/utils/backup.sh as a URL? Very strange. How do you usually run this command from the shell?
Give your script an identical path as you'd have on your login.
# 12  
Old 08-11-2010
When I normally run this I just navigate to the directory, then execute backup.sh the script then runs without issues.

---------- Post updated 08-11-10 at 09:46 AM ---------- Previous update was 08-10-10 at 06:50 PM ----------

Thank you for the help everyone I was able to get it figured out. I changed the script the following lines way to get it to work

Code:
#!/bin/bash
export PATH=/opt/data1/BAM/utils:/opt/data1/BAM/bin:/usr/local/jdk1.6.0_16/bin:
JAVA_HOME="/opt/java/jdk"

cd /opt/data1/BAM/utils
java -classpath "MicroXML.jar:log4j.jar:fileIO.jar:logging-server.jar:br-server.jar:core-server.jar:ds-server.jar:postgresql-8.1-404.jdbc2ee.jar" \
org.mg.br.server.utils.BackupRestoreCli -action backup -xml BackupRestoreConfig.xml

Thanks again!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron issue

i have written a script to sftp yesterday's logs from another server as below: cd /export/home/abc/xyz/tt d=`gdate -d'yesterday' +%Y%m%d` sftp abc@XXX.XX.XX.XX<<EOF cd /yyy/logs/archive mget abc.log.$d* EOF cd /export/home/abc/xyz/scripts nohup ./ss.sh PROD & it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies

2. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

3. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

4. UNIX for Dummies Questions & Answers

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

5. UNIX for Advanced & Expert Users

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

6. Shell Programming and Scripting

Issue with Cron

Hi Gurus, I need to run a script every saturday at 7:05 PM. Below command is working in x86_64. 05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh However when I tried in HP-UX it is giving the below error. crontab: error on previous line; unexpected character found in line. Please... (4 Replies)
Discussion started by: svajhala
4 Replies

7. Shell Programming and Scripting

A Cron Issue

Hi Guys.,, This thing is driving me crazy.. I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually. But when i am running it from crontab, the script is not sending mail to me but to my id(login id)... (0 Replies)
Discussion started by: mac4rfree
0 Replies

8. Red Hat

cron issue

Hello, Having and issue with a job scheduled in cron. The script: #!/bin/bash 2 3 # Example shell script which can be added to roots cron job to check the 4 # Embedded Satellite disk space usage. If any table is over 90% usage, send 5 # a notice to the default email address... (2 Replies)
Discussion started by: mgb
2 Replies

9. Solaris

Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9. export EDITOR="vi" is set in my profile I am using BASH $ sudo crontab -l Password: #ident "@(#)root ... (5 Replies)
Discussion started by: kingdbag
5 Replies

10. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies
Login or Register to Ask a Question