|
Last change
on this file since 77 was
77,
checked in by waue, 16 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 | |
|---|
| 18 | if [ $JAVA_HOME = "" ];then |
|---|
| 19 | export JAVA_HOME=/usr/lib/jvm/java-6-sun |
|---|
| 20 | fi |
|---|
| 21 | |
|---|
| 22 | # export NUTCH_HOME=/opt/nutch |
|---|
| 23 | |
|---|
| 24 | . /opt/nutch/bin/nutchez-func.sh |
|---|
| 25 | #. ~/.nutchez/hadoop-env.sh |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | init_nutchez |
|---|
| 30 | |
|---|
| 31 | CHECK=0 |
|---|
| 32 | while [ $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 |
|---|
| 98 | done |
|---|
| 99 | |
|---|
| 100 | set_nutchez_p |
|---|
| 101 | |
|---|
| 102 | start_crawl |
|---|
| 103 | |
|---|
| 104 | start_tomcat |
|---|
| 105 | |
|---|
| 106 | # show result message |
|---|
| 107 | |
|---|
| 108 | show_report |
|---|
| 109 | |
|---|
| 110 | # Done |
|---|
| 111 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.