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

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

change the argument number

  • Property svn:executable set to *
File size: 1.4 KB
Line 
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# $1 should be the collection name
4# $2 should be the oai URL
5# $3 should the cache directory
6# $4 should be the max records
7# $5 should be the OAI metadata prefix
8# $6 should be GS3 root
9# $7 should be the collection directory
10# $8 should the log file
11# $9 should be the creator
12# $10 should be the proxy settings
13GS3_ROOT=$6
14COLLECT_DIR=$7
15LOG_FILE=$8
16
17
18TOMCAT_ID=`ps ux | grep tomcat | grep java | grep -v grep | awk -F" " '{ print $2 }'`
19echo Tomcat_ID: $TOMCAT_ID
20#cd /usr/sbin
21NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
22echo open files: $NUM_OPEN_FILES
23
24rm -f $LOG_FILE
25cd $GS3_ROOT
26
27source gs3-setup.sh > $LOG_FILE
28
29cd gs2build/
30source setup.bash >> $LOG_FILE
31
32perl -S mkcol.pl -gs3mode -collectdir $COLLECT_DIR $1
33
34echo $1 $2 $3 $4 $5 $6 $7 $8 >> $LOG_FILE
35
36NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
37echo open files: $NUM_OPEN_FILES
38
39if [ ! -e $3 ] # be sure the cache directory exists
40then
41 mkdir $3
42else
43 /bin/rm -rf $3/*
44fi
45
46echo "Away to download OAI" >> $LOG_FILE
47
48NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
49echo open files: $NUM_OPEN_FILES
50
51downloadfrom.pl -download_mode OAI -cache_dir $3 -url $2 -max_records $4 -metadata_prefix $5 $9 2>&1 >> $LOG_FILE
52
53NUM_OPEN_FILES=`/usr/sbin/lsof -p $TOMCAT_ID | wc -l `
54echo open files: $NUM_OPEN_FILES
55
56
Note: See TracBrowser for help on using the repository browser.