X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Firspy-update.sh;h=7088875cb8c3cfc5e7910308f83e104532bbba66;hp=90d52594f44fbfcc234e4ed6ffdf690a375aec7e;hb=7cfd357a4adad76aa368d2198f3756c83e86a708;hpb=60ac227b4a81f6d5f5b60bce0dc6321a9008e82f diff --git a/bin/irspy-update.sh b/bin/irspy-update.sh index 90d5259..7088875 100755 --- a/bin/irspy-update.sh +++ b/bin/irspy-update.sh @@ -1,18 +1,43 @@ #!/bin/sh +# Copyright (c) 2010 Index Data, http://www.indexdata.com # -# wrapper for irspy.pl +# irspy-update.sh - wrapper for irspy.pl # # run irspy with a smaller set of records in a loop to avoid out-of-memory # +# for a fast update, run this: +# $ env irspy_test=Quick ./irspy-update.sh home=/usr/local/src/git cd $home/irspy/bin || exit 2 -logdir=../tmp +logdir=../log +lockfile=$logdir/irspy-update.lock +statusfile=$logdir/irspy-last-update.log +# run a full update by default, use Quick for a fast update +: ${irspy_test=Main} + +mkdir -p $logdir || exit2 + +if [ -f $lockfile ]; then + pid=`cat $lockfile` + if kill -0 $pid 2>/dev/null; then + echo "This script is already running with pid: $pid" + exit 1 + fi +fi +echo $$ > $lockfile || exit 2 + +weekday=`date '+%w'` for i in 0 1 2 3 4 5 6 do - logfile=$logdir/irspy-mod-$i.log.`date '+%w'` - YAZ_LOG=irspy,irspy_test nice -10 time perl -I../lib irspy.pl -n 50 -d -M 3500 -a -t Main -m 7,$i localhost:8018/IR-Explain---1 > $logfile 2>&1 + logfile=$logdir/irspy-mod-$i.log.$weekday + YAZ_LOG=irspy,irspy_test,irspy_task nice -10 time perl -I../lib irspy.pl -n 50 -d -M 3500 -f'cql.allRecords=1 not zeerex.disabled = 1' -t $irspy_test -m 7,$i localhost:8018/IR-Explain---1 > $logfile 2>&1 + + sleep 1 # catch ctr-c before compressing the log gzip -f $logfile done +rm -f $lockfile +date > $statusfile +