You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Siddhartha Reddy <si...@grok.in> on 2008/03/20 11:45:07 UTC
Re: Error crawl in cygwin cron.
The environment in which cronjobs run is not the same as the environment in
which applications that are started from the console run. The cronjob
environment usually has fewer environment variables set (those environment
variables set in /etc/profile or any of the bash rc scripts do not get
exported to the cronjob environment); in this case, the JAVA_HOME
environment is not set for the cronjob.
Assuming you are in Linux (this does not work for FreeBSD, I reckon), you
can set the JAVA_HOME environment variable for your cronjobs by adding the
following line at the beginning of the crontab:
JAVA_HOME=/path/to/java_home
Cron will automatically export the above environment variable before running
your script.
Regards,
Siddhartha Reddy
On Thu, Mar 20, 2008 at 2:48 PM, <ja...@163.com> wrote:
> i download nutch-2008-03-19_06-13-38.tar.gz, and try to recrawl use crawl.
>
> nutch/bin/crawl.sh
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> #!/bin/bash
> cd /nutch
> bin/nutch crawl urls -dir crawl -depth 1 -topN 5 >> /tmp/crawl.log
> #touch $CATALINA_HOME/webapps/nutch/WEB-INF/web.xml
> cd /
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> crontab -e
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> 12 17 * * * /nutch/bin/crawl.sh
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> when i only use crawl.sh, it is correct. but when i use crawl.sh with
> cron.
> /tmp/crawl.log get:"Error: JAVA_HOME is not set."
>
> i don't know what' wrong. help.
>
> thanks.
--
http://sids.in
"If you are not having fun, you are not doing it right."