source: nutchez-0.1/bin/nutchez @ 77

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

good

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