You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by cu...@apache.org on 2005/08/19 23:37:21 UTC

svn commit: r233564 - /lucene/nutch/branches/mapred/bin/nutch-daemon.sh

Author: cutting
Date: Fri Aug 19 14:37:19 2005
New Revision: 233564

URL: http://svn.apache.org/viewcvs?rev=233564&view=rev
Log:
Add rsync of code & conf to local copy before daemon started.

Modified:
    lucene/nutch/branches/mapred/bin/nutch-daemon.sh

Modified: lucene/nutch/branches/mapred/bin/nutch-daemon.sh
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/bin/nutch-daemon.sh?rev=233564&r1=233563&r2=233564&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/bin/nutch-daemon.sh (original)
+++ lucene/nutch/branches/mapred/bin/nutch-daemon.sh Fri Aug 19 14:37:19 2005
@@ -5,19 +5,8 @@
 # Environment Variables
 #
 #   NUTCH_LOG_DIR   Where log files are stored.  PWD by default.
-#
-
-# resolve links - $0 may be a softlink
-this="$0"
-while [ -h "$this" ]; do
-  ls=`ls -ld "$this"`
-  link=`expr "$ls" : '.*-> \(.*\)$'`
-  if expr "$link" : '.*/.*' > /dev/null; then
-    this="$link"
-  else
-    this=`dirname "$this"`/"$link"
-  fi
-done
+#   NUTCH_MASTER    host:path where nutch code should be rsync'd from
+##
 
 usage="Usage: nutch-daemon [start|stop] [nutch-command] [args...]"
 
@@ -33,11 +22,21 @@
 command=$1
 shift
 
-# some directories
-this_dir=`dirname "$this"`
+# resolve links - $0 may be a softlink
+this="$0"
+while [ -h "$this" ]; do
+  ls=`ls -ld "$this"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '.*/.*' > /dev/null; then
+    this="$link"
+  else
+    this=`dirname "$this"`/"$link"
+  fi
+done
 
+# get log directory
 if [ "$NUTCH_LOG_DIR" = "" ]; then
-  NUTCH_LOG_DIR=.
+  NUTCH_LOG_DIR=$PWD
 fi
 
 # some variables
@@ -55,8 +54,15 @@
       fi
     fi
 
+    root=`dirname $this`/..
+    if [ "$NUTCH_MASTER" != "" ]; then
+      echo rsync from $NUTCH_MASTER
+      rsync -a --delete --exclude=.svn $NUTCH_MASTER/{build,bin,lib,conf} $root
+    fi
+
+    cd $root
     echo starting $command, logging to $log
-    nohup $this_dir/nutch $command "$@" >& $log < /dev/null &
+    nohup bin/nutch $command "$@" >& $log < /dev/null &
     echo $! > $pid
     sleep 1; head $log
     ;;