Dear Wiki user, You have subscribed to a wiki page or wiki category on "Nutch Wiki" for change notification.
The "Whole-Web Crawling incremental script" page has been changed by Gabriele Kahlout. The comment on this change is: takes arg parameters . http://wiki.apache.org/nutch/Whole-Web%20Crawling%20incremental%20script?action=diff&rev1=17&rev2=18 -------------------------------------------------- # 3. $ chmod +x whole-web-crawling-incremental # 4. $ ./whole-web-crawling-incremental - # Usage: ./whole-web-crawling-incremental [it_seedsDir-path urls-to-fetch-per-iteration depth] + # Usage: ./whole-web-crawling-incremental [-f] [-i urls-to-fetch-per-iteration] [-d depth] [seedsDir-path] # Start function echoThenRun () { # echo and then run the command @@ -248, +248 @@ echo } - echoThenRun "bin/hadoop dfs -rmr crawl" # fresh crawl - + it_size=10 + depth=1 + fresh=false solrIndex="http://localhost:8080/solr" + seedsDir="seeds" + + while getopts "fi:d:" option + do + case $option in + f) fresh=true;; + i) it_size=$OPTARG;; + d) depth=$OPTARG;; + esac + done + + if [[ ${@:$OPTIND} != "" ]] + then + seedsDir=${@:$OPTIND} + fi + + + if $fresh ; then + echoThenRun "bin/hadoop dfs -rmr crawl" - echoThenRun "curl --fail $solrIndex/update?commit=true -d '<delete><query>*:*</query></delete>'" #empty index + echoThenRun "curl --fail $solrIndex/update?commit=true -d '<delete><query>*:*</query></delete>'" #empty index - + fi if [[ ! -d "build" ]] then echoThenRun "ant" - fi - - seedsDir="seeds" - if [[ $1 != "" ]] - then - seedsDir=$1 - fi - - it_size=10 - if [[ $2 != "" ]] - then - it_size=$2 fi indexedPlus1=1 #indexedPlus1 urls+1 because of tail. Never printed out @@ -283, +291 @@ allUrls=`cat $seedsDir/urls-local-only | wc -l | sed -e "s/^ *//"` echo $allUrls" urls to crawl" - - - depth=1 - if [[ $3 != "" ]] - then - depth=$3 - fi j=0 @@ -314, +315 @@ while [[ $i -lt $depth ]] # depth-first do echo + echo "generate-fetch-updatedb-invertlinks-index-merge iteration "$i":" + cmd="bin/nutch generate $it_crawldb crawl/segments -topN $it_size" echo $cmd output=`$cmd`

