LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron won't load my programs.... (https://www.linuxquestions.org/questions/linux-newbie-8/cron-wont-load-my-programs-349607/)

haora 08-03-2005 11:03 AM

cron won't load my programs....
 
Hi all..., I'm trying to create a cronjob to call Azureus (I think that's the name) every day..., now, what I do is:

1 - Add this line in the cron file:

0 13 * * 1-4 /home/fernando/azureus/loadAz.sh

The script "loadAz.sh" is this:


#!/bin/sh

cd /home/fernando/azureus/;

JAVA_BIN_=`which java`

$JAVA_BIN_ -cp swt.jar:Azureus2.2.0.2.jar -Djava.library.path=. org.gudy.azureus2.ui.swt.Main

err=`echo $?`

if [ $err -gt 1 ];
then
echo "There was an error" >> logAz.log
else
echo "Everything good" >> logAz.log
fi
exit;

Now, if I run that script manually, it works great, and Azureus gets loaded..., but if cron runs the cron job, I get this error:

which: no java in (/usr/bin:/bin)
/home/fernando/azureus/loadAz.sh: line 7: -cp: command not found


What's up with that????

Why does it work when I run it manually, and not when cron runs it????

Any ideas?

Thanks in advance!

Fernando

Kdr Kane 08-03-2005 11:19 AM

Quote:

which: no java in (/usr/bin:/bin)
cron does not have the same search path that your username has.

Give the absolute path in your script or change the search path for cron.

haora 08-03-2005 01:25 PM

Well, now it is actually calling the script, but azureus is crashing, I get this error in the log:


2277 DEBUG::Wed Aug 03 15:10:06 ART 2005::org.gudy.azureus2.core3.util.FileUtil::renameFile::816:
2278 renameFile: target file '/home/fernando/.Azureus/logs/save/0_debug_1.log' already exists, failing
2279 AEDiagnostics::startup::134,AzureusCoreImpl::<init>::106,AzureusCoreImpl::create::67,AzureusCoreFact ory::create::46,Main::<init> ::35,Main::main::100
2280 Exception in thread "main" org.eclipse.swt.SWTError: No more handles
2281 at org.eclipse.swt.SWT.error(SWT.java:2717)
2282 at org.eclipse.swt.SWT.error(SWT.java:2616)
2283 at org.eclipse.swt.SWT.error(SWT.java:2587)
2284 at org.eclipse.swt.widgets.Display.createDisplay(Display.java:709)
2285 at org.eclipse.swt.widgets.Display.create(Display.java:694)
2286 at org.eclipse.swt.graphics.Device.<init>(Device.java:113)
2287 at org.eclipse.swt.widgets.Display.<init>(Display.java:402)
2288 at org.eclipse.swt.widgets.Display.<init>(Display.java:398)
2289 at org.gudy.azureus2.ui.swt.mainwindow.SWTThread.<init>(SWTThread.java:71)
2290 at org.gudy.azureus2.ui.swt.mainwindow.SWTThread.createInstance(SWTThread.java:55)
2291 at org.gudy.azureus2.ui.swt.mainwindow.Initializer.<init>(Initializer.java:106)
2292 at org.gudy.azureus2.ui.swt.Main.<init>(Main.java:73)
2293 at org.gudy.azureus2.ui.swt.Main.main(Main.java:100)

Any idea what could it be???

Thanks for your help!!!!

Fernando


All times are GMT -5. The time now is 04:34 AM.