document flag "disabled"
[irspy-moved-to-github.git] / bin / irspy-update.sh
1 #!/bin/sh
2 #
3 # wrapper for irspy.pl
4 #
5 # run irspy with a smaller set of records in a loop to avoid out-of-memory
6 #
7
8 home=/usr/local/src/git
9 cd $home/irspy/bin || exit 2
10 logdir=../tmp
11 lockfile=../tmp/irspy-update.lock
12
13 if [ -f $lockfile ]; then
14     pid=`cat $lockfile`
15     if kill -0 $pid 2>/dev/null; then
16         echo "This script is already running with pid: $pid"
17         exit 1
18     fi
19 fi
20 echo $$ > $lockfile || exit 2
21
22 for i in 0 1 2 3 4 5 6
23 do
24    logfile=$logdir/irspy-mod-$i.log.`date '+%w'`
25    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
26    gzip -f $logfile
27 done
28
29 rm -f $lockfile
30