source: nutchez-0.1/bin/nutchez @ 72

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

test

  • Property svn:executable set to *
File size: 1.3 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#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 HADOOP_LOG_DIR=~/.nutchez/log
17
18. /opt/nutch/bin/nutchez-func.sh
19. ~/.nutchez/hadoop-env.sh
20
21
22
[69]23init_nutchez
[68]24
[66]25CHECK=0
26while [ $CHECK -eq 0 ]; do
27
28  LOCK=1
29  while [ $LOCK -eq 1 ]; do
30    # milestone M1
31    show_urls
32    URL=$?
33    echo_vb "2.2 show_urls return $URL"
34   
35# add or delete url:  ok , exit
36# ok =0 , exit =1
37
38    if [ $URL -eq 0 ];then
39      # go_to_M2
40      LOCK=0
41    else
42      #return_console
43      exit
44    fi
45
46  done
47  # milestone M2
48
49  # setup search engine personality
50  #   next, back
51  setup_robot
52
53  # setup the crawl paramater
54  #   next, back
55  setup_crawler
56
57  # setup the tomcat paramater
58  #   next, back
59  setup_tomcat
60
61  # show the final checklist
62  final_confirm
63  FC=$?
64  echo_vb "6.3 final confirm return = $FC "
65  #   START , back, cancel
66  # start =0 , back =1
67  if [ $FC -eq 0 ];then
68    #go_to_M3
69    CHECK=1
70    # change temp file as conf file
71    promote_tempfile
72  else
73    #go_to_M1
74    LOCK=1
75    CHECK=0
76    # temp file delete!
77    clean_tempfile
78    #return_console
79  fi
80done
81
82start_crawl
83
84start_tomcat
85
86# show result message
87
88show_report
89
90# Done
91
Note: See TracBrowser for help on using the repository browser.