use the same weekday for all runs
[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 #test=Quick
13 test=Main
14
15 if [ -f $lockfile ]; then
16     pid=`cat $lockfile`
17     if kill -0 $pid 2>/dev/null; then
18         echo "This script is already running with pid: $pid"
19         exit 1
20     fi
21 fi
22 echo $$ > $lockfile || exit 2
23
24 weekday=`date '+%w'`
25 for i in 0 1 2 3 4 5 6
26 do
27    logfile=$logdir/irspy-mod-$i.log.$weekday
28    YAZ_LOG=irspy,irspy_test,irspy_task nice -10 time perl -I../lib irspy.pl -n 50 -d -M 3500 -a -t $test -m 7,$i localhost:8018/IR-Explain---1 > $logfile 2>&1
29    gzip -f $logfile
30 done
31
32 rm -f $lockfile
33