source: other-projects/trunk/greenstone3-extension/mat/bin/script/mat-colbuild.bash@ 18086

Last change on this file since 18086 was 18086, checked in by cc108, 15 years ago

This file is used to build collection

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[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
21TOMCAT_ID=`ps ux | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'`
22echo Tomcat_ID: $TOMCAT_ID
23
24NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
25echo open files: $NUM_OPEN_FILES
26
27cd $6
28source gs3-setup.sh >> $8
29
30cd gs2build/
31source 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
38echo "Away to build" >> $8
39
40build -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
45NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
46echo open files: $NUM_OPEN_FILES
47
48echo "Build finished ...." >> $8
49
50if [ -d $6/gs2build/collect/$1 ]
51then
52 echo "moving from gs2 dir" >> $8
53 echo built in gs2 dir ... moving
54 mv $6/gs2build/collect/$1 $7/$1
55fi
56
57echo "Away to convert from Greenstone 2 to Greenstone 3" >> $8
58echo "Away to convert from Greenstone 2 to Greenstone 3"
59
60# >> $LOG_FILE
61
62convert_coll_from_gs2.pl -collectdir $7 $1
63
64NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
65echo open files: $NUM_OPEN_FILES
66# >> $LOG_FILE
67
68echo "Away to reconfigure Greenstone 3 server" >> $8
69echo "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"
74wget -O /tmp/mat3.html "http://localhost:8090/greenstone3/library?a=s&sa=c"
75
76echo "Done" >> $8
77echo "Done"
78NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
79echo open files: $NUM_OPEN_FILES
80
81/usr/sbin/lsof -p $TOMCAT_ID
82# >> $LOG_FILE
83
84
85#exit 0
Note: See TracBrowser for help on using the repository browser.