source: nutchez-0.1/bin/nutchez @ 91

Last change on this file since 91 was 91, checked in by waue, 15 years ago

fix some bugs

  • Property svn:executable set to *
File size: 1.6 KB
RevLine 
[66]1#!/bin/bash
2# Author: WeiYu Chen <waue _at_ nchc org tw>
3# License: GPL
4# Description: Eazily use for Nutch
5# .
6
[69]7# begining ..
[67]8
[72]9
10#. "$bin"/nutchez-func.sh
11
[91]12  export JAVA_HOME=/usr/lib/jvm/java-6-sun
13  export NUTCH_HOME=/opt/nutch
14#  export HADOOP_HOME=/opt/nutch
[89]15  export NUTCH_CONF_DIR=~/.nutchez/conf
[91]16#  export HADOOP_CONF_DIR=~/.nutchez/conf
[75]17  export NUTCH_LOG_DIR=~/.nutchez/log
[77]18
19
[72]20
[91]21
[72]22. /opt/nutch/bin/nutchez-func.sh
[77]23#. ~/.nutchez/hadoop-env.sh
[72]24
25
26
[69]27init_nutchez
[68]28
[66]29CHECK=0
30while [ $CHECK -eq 0 ]; do
31
32  LOCK=1
33  while [ $LOCK -eq 1 ]; do
34    # milestone M1
35    show_urls
36    URL=$?
37    echo_vb "2.2 show_urls return $URL"
38   
39# add or delete url:  ok , exit
40# ok =0 , exit =1
41
42    if [ $URL -eq 0 ];then
43      # go_to_M2
44      LOCK=0
45    else
46      #return_console
47      exit
48    fi
49
50  done
51  # milestone M2
52
53  # setup search engine personality
54  #   next, back
55  setup_robot
56
57  # setup the crawl paramater
58  #   next, back
59  setup_crawler
60
61  # setup the tomcat paramater
62  #   next, back
63  setup_tomcat
64
65  # show the final checklist
66  final_confirm
67  FC=$?
68  echo_vb "6.3 final confirm return = $FC "
69  #   START , back, cancel
70  # start =0 , back =1
[75]71  #if [ $FC -eq 0 ];then
72  case $FC in
73    0)
74      #go_to_M3
75      CHECK=1
76      # change temp file as conf file
77      promote_tempfile
78      ;;
79    #else
80    1)
81      exit
82      ;;
83    3)
84      #go_to_M1
85      LOCK=1
86      CHECK=0
87      # temp file delete!
88      clean_tempfile
89      #return_console
90      ;;
91    255)
92      echo_vb "ESC pressed !!"
93      ;;
94  esac
95    #fi
[66]96done
97
[77]98set_nutchez_p
99
[66]100start_crawl
101
[77]102start_tomcat
[66]103
104# show result message
105
[77]106show_report
[66]107
108# Done
109
Note: See TracBrowser for help on using the repository browser.