X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Firspy-update.sh;h=58e401da27052a89e2b92cfc6e0dc2d7e6ee41e8;hp=fea275880fbcf32a51100bd0c5784f9e500d9b72;hb=058b3e0d9003ae8a44fe920ae9ccf7efd6554877;hpb=1e9645561322ce22c8366f0126127bf97731e7eb diff --git a/bin/irspy-update.sh b/bin/irspy-update.sh index fea2758..58e401d 100755 --- a/bin/irspy-update.sh +++ b/bin/irspy-update.sh @@ -8,11 +8,27 @@ home=/usr/local/src/git cd $home/irspy/bin || exit 2 logdir=../tmp +lockfile=../tmp/irspy-update.lock +: ${irspy_test=Main} +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 -a -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 +