dcsimg
Crontab & Java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Silvia_Coloni
Posted On:   Tuesday, October 21, 2003 01:27 PM

Hello, I am trying to call a script, which one calls a java program. I already set PATH and CLASSPATH in that script and when I execute it outside crontab, it works very well. But, when I call the script by the crontab it doesn´t work. So, the service is started for sure because the crontab can execute shell´s scripts. Just doesn´t work with Java instruction. Do you have any idea? Take a look at my scrip and my crontab file My Script ExecutaCron: #!/bin/bash PATH={$PATH}:/usr/java/j2sdk1.4.1_01/bin; export PATH; CLASSPATH={$CLASSPATH}:/usr/java/j2sdk1.4.1_01/lib; export CLASSPATH; java -D CronBuffer /home/mygridgene/ProjetoJava/saida.txt #whe   More>>

Hello, I am trying to call a script, which one calls a java program. I already set PATH and CLASSPATH in that script and when I execute it outside crontab, it works very well. But, when I call the script by the crontab it doesn´t work. So, the service is started for sure because the crontab can execute shell´s scripts. Just doesn´t work with Java instruction. Do you have any idea?

Take a look at my scrip and my crontab file

My Script ExecutaCron:

#!/bin/bash

PATH={$PATH}:/usr/java/j2sdk1.4.1_01/bin; export PATH;

CLASSPATH={$CLASSPATH}:/usr/java/j2sdk1.4.1_01/lib; export CLASSPATH;

java -D CronBuffer /home/mygridgene/ProjetoJava/saida.txt

#where CronBuffer is my java class.

Crontab:

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=mygridgene

HOME=/home/mygridgene

54 16 * * * ./home/mygridgene/ProjetoJava/ExecutaCron



Please use html tags to format code blocks.

   <<Less

Re: Crontab & Java

Posted By:   Anonymous  
Posted On:   Wednesday, October 22, 2003 02:14 AM

What is the exact error message? Maybe crontab is running as a different user without privileges to do the command.
About | Sitemap | Contact