X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=inline;f=helm%2Fmatita%2Fscripts%2Fcrontab.sh;h=f4c7b4a8e67adf341b212fe7da73ed3c3dd8d6b2;hb=b9af9f1c0de6a1735b492f5c793a87a8fce218cc;hp=20bd7b07607aeff19120279386598e90bd683eab;hpb=ead8e902e45327ce477615a5f4f6608a5f36350e;p=helm.git diff --git a/helm/matita/scripts/crontab.sh b/helm/matita/scripts/crontab.sh index 20bd7b076..f4c7b4a8e 100644 --- a/helm/matita/scripts/crontab.sh +++ b/helm/matita/scripts/crontab.sh @@ -8,22 +8,28 @@ OLD=$PWD rm -rf $TMPDIRNAME mkdir $TMPDIRNAME cd $TMPDIRNAME -#cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null -#helm/matita/scripts/profile_cvs.sh 2> LOG +cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null +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 - ((DELTA=$DELTA * -1)) + PERC=0 +else + ((PERC=100 * $DELTA)) + ((PERC=$PERC / $OLD_TIME)) fi -((PERC=100 * $DELTA)) -((PERC=$PERC / $OLD_TIME)) - if [ $PERC -ge 5 ]; then cat <