X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fscripts%2Fcrontab.sh;h=f4c7b4a8e67adf341b212fe7da73ed3c3dd8d6b2;hb=f981a524748846acc29b76b6e616af110b4ee13d;hp=ccbe4c8f1fdbc3980b45e9d0c4f001b3dda190b7;hpb=f61316e2906cd8eecb73b1982b1784661702fd93;p=helm.git diff --git a/helm/matita/scripts/crontab.sh b/helm/matita/scripts/crontab.sh index ccbe4c8f1..f4c7b4a8e 100644 --- a/helm/matita/scripts/crontab.sh +++ b/helm/matita/scripts/crontab.sh @@ -1,4 +1,6 @@ +#!/bin/bash MARK=`date +%Y%m%d` +LASTMARK=`date -d yesterday +%Y%m%d` TMPDIRNAME=.__${MARK}_crontab CVSROOT=":ext:$USER@marcello.cs.unibo.it:/home/faculty/PROJECTS/cvs/helm" @@ -7,23 +9,53 @@ rm -rf $TMPDIRNAME mkdir $TMPDIRNAME cd $TMPDIRNAME cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null -bash helm/matita/scripts/profile_cvs.sh > LOG +helm/matita/scripts/profile_cvs.sh 2> LOG + +CUR_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$MARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | awk '{print $2}'` +OLD_TIME=`echo "select mark, SUM(TIME_TO_SEC(time)) from bench where mark = \"$LASTMARK\" group by mark;" | mysql -u helm -h mowgli.cs.unibo.it matita | tail -n 1 | awk '{print $2}'` + +if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then + echo "No benchamks records for $MARK" + exit 1 +fi + +((DELTA=$CUR_TIME - $OLD_TIME)) +if [ $DELTA -lt 0 ]; then + PERC=0 +else + ((PERC=100 * $DELTA)) + ((PERC=$PERC / $OLD_TIME)) +fi +if [ $PERC -ge 5 ]; then + cat <