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: fixed a bug with depth, simplified, and initial 
support (untested) for resuming crawls.
http://wiki.apache.org/nutch/Whole-Web%20Crawling%20incremental%20script?action=diff&rev1=16&rev2=17

--------------------------------------------------

  
          while [[ $i -lt $depth ]]
          do
+                 echo
+                 echo "generate-fetch-updatedb-invertlinks-index-merge 
iteration "$i":"
                  cmd="bin/nutch generate $it_crawldb crawl/segments -topN 
$it_size"
                  output=`$cmd`
                  if [[ $output == *'0 records selected for fetching'* ]]
@@ -289, +291 @@

        depth=$3
  fi
  
+ 
  j=0
  while [[ $indexedPlus1 -le $allUrls ]] #repeat 
generate-fetch-updatedb-invertlinks-index-merge loop until all urls are fetched
  do
@@ -296, +299 @@

        
        tail -n+$indexedPlus1 $seedsDir/urls-local-only | head -n$it_size > 
$it_seedsDir/urls-local-only
        bin/hadoop dfs -moveFromLocal $it_seedsDir/urls-local-only 
$it_seedsDir/urls
-       
+               
-       it_crawldb="crawl/crawldb/$j/0"
+       it_crawldb="crawl/crawldb/$j"
+       if [[ -d $it_crawldb ]] # resuming crawl
+       then
+               bin/hadoop dfs -rmr crawl/segments #should be empty if we 
indexed them - atomicity at $j level.
+       else
-       bin/hadoop dfs -mkdir $it_crawldb
+               bin/hadoop dfs -mkdir $it_crawldb
-       
-       echo
+               echo
-       echoThenRun "bin/nutch inject $it_crawldb $it_seedsDir"
+               echoThenRun "bin/nutch inject $it_crawldb $it_seedsDir"
-       i=0
-       
+       fi
+ 
+     i=0
        while [[ $i -lt $depth ]] # depth-first
-       do
+       do              
-               echo "generate-fetch-updatedb-invertlinks-index-merge iteration 
"$i":"
-               
-               it_crawldb="crawl/crawldb/$j/$i"
-               
                echo
                cmd="bin/nutch generate $it_crawldb crawl/segments -topN 
$it_size"
                echo $cmd
@@ -327, +330 @@

  
                echoThenRun "bin/nutch invertlinks crawl/linkdb -dir 
crawl/segments"
  
- 
                echoThenRun "bin/nutch solrindex $solrIndex $it_crawldb 
crawl/linkdb crawl/segments/*"
  
-               # you can now search the index with 
http://localhost:8080/solr/admin/ (if setup) or http://code.google.com/p/luke/ 
. The index is stored in $NUTCH_HOME/solr/data/index.
+               # you can now search the index with 
http://localhost:8080/solr/admin/ (if setup) or http://code.google.com/p/luke/ 
. The index is stored in crawl/indexes, while if Solr is used then in 
$NUTCH_HOME/solr/data/index.
+               
+               bin/hadoop dfs -rmr crawl/segments/2*
                ((i++))
                ((indexedPlus1+=$it_size)) # maybe should readdb crawl/crawldb 
-stats number of actually fetched, but (! going to fetch a page) --> infinite 
loop
                echo
        done
  
        echoThenRun "bin/nutch readdb $it_crawldb -stats"
- 
-       allcrawldb="crawl/allcrawldb"
-       temp_crawldb="crawl/temp_crawldb"
-       merge_dbs="$it_crawldb $allcrawldb"
- 
-       # work-around for https://issues.apache.org/jira/browse/NUTCH-972 
(Patch available)
-       if [[ ! -d $allcrawldb ]]
-       then
-               merge_dbs="$it_crawldb"
-       fi
- 
-       #echoThenRun "bin/nutch mergedb $temp_crawldb $merge_dbs"
- 
-       #rm -r $allcrawldb $it_crawldb crawl/segments crawl/linkdb
-       #mv $temp_crawldb $allcrawldb
        ((j++))
  done
  

Reply via email to