Changeset 21996 for gs3-extensions/mat
- Timestamp:
- 2010-04-29T16:34:05+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/mat/trunk/bin/script/mat-colbuild.bash
r18086 r21996 1 #!/bin/bash 1 2 # if this file is executed, /bin/sh is used, as we don't start with #! 2 3 # this should work under ash, bash, zsh, ksh, sh style shells. 3 4 5 6 4 # $1 should be the collection name 7 5 # $2 should be the oai URL … … 12 10 # $7 should be the collection directory 13 11 # $8 should the log file 12 # $9 should be the host name : port number 14 13 15 14 #$GS3_ROOT=$6 16 15 #$COLLECT_DIR=$7 17 16 #$LOG_FILE=$8 17 CACHE_DIR=$3 18 18 19 19 # check we are still in the right directories 20 21 if [ -x /usr/bin/lsof ] ; then 22 lsof=/usr/bin/lsof 23 else 24 if [ -x /usr/sbin/lsof ] ; then 25 lsof=/usr/sbin/lsof 26 else 27 echo "Warning: Unable to find 'lsof', skipping test for number of files open" 28 fi 29 fi 20 30 21 31 TOMCAT_ID=`ps ux | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'` 22 32 echo Tomcat_ID: $TOMCAT_ID 23 33 24 NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l ` 25 echo open files: $NUM_OPEN_FILES 34 if [ ! -z "$lsof" ] ; then 35 NUM_OPEN_FILES=`$lsof -p $TOMCAT_ID | wc -l ` 36 echo open files: $NUM_OPEN_FILES 37 fi 26 38 27 39 cd $6 … … 38 50 echo "Away to build" >> $8 39 51 40 build -indextype lucene -site localsite -collectdir $7 -log_events -download file://$ 3$1 2>&152 build -indextype lucene -site localsite -collectdir $7 -log_events -download file://$CACHE_DIR $1 2>&1 41 53 #2>&1 >> $LOG_FILE 42 54 43 55 # -log_events 44 56 # >> $LOG_FILE 45 NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l ` 46 echo open files: $NUM_OPEN_FILES 57 if [ ! -z "$lsof" ] ; then 58 NUM_OPEN_FILES=`$lsof -p $TOMCAT_ID | wc -l ` 59 echo open files: $NUM_OPEN_FILES 60 fi 47 61 48 62 echo "Build finished ...." >> $8 … … 60 74 # >> $LOG_FILE 61 75 62 convert_coll_from_gs2.pl -collectdir $7 $1 63 64 NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l ` 65 echo open files: $NUM_OPEN_FILES 66 # >> $LOG_FILE 76 if [ ! -z "$lsof" ] ; then 77 NUM_OPEN_FILES=`$lsof -p $TOMCAT_ID | wc -l ` 78 echo open files: $NUM_OPEN_FILES 79 # >> $LOG_FILE 80 fi 67 81 68 82 echo "Away to reconfigure Greenstone 3 server" >> $8 … … 72 86 73 87 #wget -O /tmp/mat5.html "http://localhost:8090/greenstone3/library?a=s&sa=c" 74 wget -O /tmp/mat3.html "http:// localhost:8090/greenstone3/library?a=s&sa=c"88 wget -O /tmp/mat3.html "http://$9/greenstone3/library?a=s&sa=c" 75 89 76 90 echo "Done" >> $8 77 91 echo "Done" 78 NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `79 echo open files: $NUM_OPEN_FILES80 92 81 /usr/sbin/lsof -p $TOMCAT_ID 93 if [ ! -z "$lsof" ] ; then 94 NUM_OPEN_FILES=`$lsof -p $TOMCAT_ID | wc -l ` 95 echo open files: $NUM_OPEN_FILES 96 97 $lsof -p $TOMCAT_ID 82 98 # >> $LOG_FILE 99 fi 83 100 84 101
Note:
See TracChangeset
for help on using the changeset viewer.