Author: jnioche
Date: Thu Apr 17 09:59:54 2014
New Revision: 1588196

URL: http://svn.apache.org/r1588196
Log:
NUTCH-1761 Crawl script fails to find job file if not started from inside bin 
dir (David Hosking, jnioche)

Modified:
    nutch/trunk/CHANGES.txt
    nutch/trunk/src/bin/crawl

Modified: nutch/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/nutch/trunk/CHANGES.txt?rev=1588196&r1=1588195&r2=1588196&view=diff
==============================================================================
--- nutch/trunk/CHANGES.txt (original)
+++ nutch/trunk/CHANGES.txt Thu Apr 17 09:59:54 2014
@@ -2,6 +2,8 @@ Nutch Change Log
 
 Nutch Current Development
 
+* NUTCH-1761 Crawl script fails to find job file if not started from inside 
bin dir (David Hosking, jnioche)
+
 * NUTCH-1603 ZIP parser complains about truncated PDF file (snagel)
 
 * NUTCH-1720 Duplicate lines in HttpBase.java (Walter Tietze via jnioche)

Modified: nutch/trunk/src/bin/crawl
URL: 
http://svn.apache.org/viewvc/nutch/trunk/src/bin/crawl?rev=1588196&r1=1588195&r2=1588196&view=diff
==============================================================================
--- nutch/trunk/src/bin/crawl (original)
+++ nutch/trunk/src/bin/crawl Thu Apr 17 09:59:54 2014
@@ -69,16 +69,15 @@ numThreads=50
 
 #############################################
 
-# determines whether mode based on presence of job file
+bin=`dirname "$0"`
+bin=`cd "$bin"; pwd`
 
+# determines whether mode based on presence of job file
 mode=local
-if [ -f ../*nutch-*.job ]; then
+if [ -f ${bin}/../*nutch*.job ]; then
     mode=distributed
 fi
 
-bin=`dirname "$0"`
-bin=`cd "$bin"; pwd`
-
 # note that some of the options listed here could be set in the 
 # corresponding hadoop site xml param file 
 commonOptions="-D mapred.reduce.tasks=$numTasks -D 
mapred.child.java.opts=-Xmx1000m -D 
mapred.reduce.tasks.speculative.execution=false -D 
mapred.map.tasks.speculative.execution=false -D mapred.compress.map.output=true"


Reply via email to