[18086] | 1 | # if this file is executed, /bin/sh is used, as we don't start with #!
|
---|
| 2 | # this should work under ash, bash, zsh, ksh, sh style shells.
|
---|
| 3 |
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | # $1 should be the collection name
|
---|
| 7 | # $2 should be the oai URL
|
---|
| 8 | # $3 should the cache directory
|
---|
| 9 | # $4 should be the max records
|
---|
| 10 | # $5 should be the OAI metadata prefix
|
---|
| 11 | # $6 should be GS3 root
|
---|
| 12 | # $7 should be the collection directory
|
---|
| 13 | # $8 should the log file
|
---|
| 14 |
|
---|
| 15 | #$GS3_ROOT=$6
|
---|
| 16 | #$COLLECT_DIR=$7
|
---|
| 17 | #$LOG_FILE=$8
|
---|
| 18 |
|
---|
| 19 | # check we are still in the right directories
|
---|
| 20 |
|
---|
| 21 | TOMCAT_ID=`ps ux | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'`
|
---|
| 22 | echo Tomcat_ID: $TOMCAT_ID
|
---|
| 23 |
|
---|
| 24 | NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
|
---|
| 25 | echo open files: $NUM_OPEN_FILES
|
---|
| 26 |
|
---|
| 27 | cd $6
|
---|
| 28 | source gs3-setup.sh >> $8
|
---|
| 29 |
|
---|
| 30 | cd gs2build/
|
---|
| 31 | source setup.bash >> $8
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | # event log goes to greenstone3/gs2build/etc/events.txt
|
---|
| 35 |
|
---|
| 36 | ## build -indextype lucene -site localsite -collectdir $COLLECT_DIR -download file://$3 -log_events $1
|
---|
| 37 |
|
---|
| 38 | echo "Away to build" >> $8
|
---|
| 39 |
|
---|
| 40 | build -indextype lucene -site localsite -collectdir $7 -log_events -download file://$3 $1 2>&1
|
---|
| 41 | #2>&1 >> $LOG_FILE
|
---|
| 42 |
|
---|
| 43 | # -log_events
|
---|
| 44 | # >> $LOG_FILE
|
---|
| 45 | NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
|
---|
| 46 | echo open files: $NUM_OPEN_FILES
|
---|
| 47 |
|
---|
| 48 | echo "Build finished ...." >> $8
|
---|
| 49 |
|
---|
| 50 | if [ -d $6/gs2build/collect/$1 ]
|
---|
| 51 | then
|
---|
| 52 | echo "moving from gs2 dir" >> $8
|
---|
| 53 | echo built in gs2 dir ... moving
|
---|
| 54 | mv $6/gs2build/collect/$1 $7/$1
|
---|
| 55 | fi
|
---|
| 56 |
|
---|
| 57 | echo "Away to convert from Greenstone 2 to Greenstone 3" >> $8
|
---|
| 58 | echo "Away to convert from Greenstone 2 to Greenstone 3"
|
---|
| 59 |
|
---|
| 60 | # >> $LOG_FILE
|
---|
| 61 |
|
---|
| 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
|
---|
| 67 |
|
---|
| 68 | echo "Away to reconfigure Greenstone 3 server" >> $8
|
---|
| 69 | echo "Away to reconfigure Greenstone 3 server"
|
---|
| 70 |
|
---|
| 71 | # >> $LOG_FILE
|
---|
| 72 |
|
---|
| 73 | #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"
|
---|
| 75 |
|
---|
| 76 | echo "Done" >> $8
|
---|
| 77 | echo "Done"
|
---|
| 78 | NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
|
---|
| 79 | echo open files: $NUM_OPEN_FILES
|
---|
| 80 |
|
---|
| 81 | /usr/sbin/lsof -p $TOMCAT_ID
|
---|
| 82 | # >> $LOG_FILE
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | #exit 0
|
---|