X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fscripts%2Fcrontab.sh;h=06cb81654aaa69600992ee60a636ee291be370be;hb=a957099550619f87a58be467b9b11f2ad6501378;hp=64708ba77e3916d53917fb9453301a0682177163;hpb=af53198f0c7b597fc1376261298f980add9b25d3;p=helm.git diff --git a/matita/scripts/crontab.sh b/matita/scripts/crontab.sh index 64708ba77..06cb81654 100644 --- a/matita/scripts/crontab.sh +++ b/matita/scripts/crontab.sh @@ -1,4 +1,5 @@ #!/bin/bash +#set -x #configuration TODAY=`date +%Y%m%d` @@ -10,14 +11,11 @@ SHELLTIME2CENTSPHP=scripts/shell_time2cents.php SHELLADDERPHP=scripts/shell_adder.php COMMONPHP=scripts/public_html/common.php MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita" -SQLQMARK="select distinct mark from bench where mark like '" -SQLQORD="' order by mark;" -SQLQTIME="select SUM(timeuser) from bench where mark = \"" -SQLQGRMARK="\" group by mark;" -SQLQFAIL="select count(distinct test) from bench where mark = \"" -SQLQFAIL1="select distinct test from bench where mark = \"" -SQLQFAIL2="\" and result = 'fail';" -URL="http://mowgli.cs.unibo.it/~tassi/bench.php" +SQLQMARK="select distinct mark from bench where mark like '%s%%' order by mark;" +SQLQTIME="select SUM(timeuser) from bench where mark = '%s' group by mark;" +SQLQFAILCOUNT="select count(distinct test) from bench where mark = '%s' and result = 'fail';" +SQLQFAIL="select distinct test from bench where mark = '%s' and result = 'fail';" +URL="http://mowgli.cs.unibo.it/~sacerdot/bench.php" #initialization OLD=$PWD @@ -30,8 +28,8 @@ svn co ${SVNROOT}helm/software/matita/scripts/ > LOG.svn 2>&1 #run tests scripts/profile_svn.sh 2> LOG -MARK=`echo $SQLQMARK$TODAY%$SQLQORD | $MYSQL | tail -n 1` -LASTMARK=`echo $SQLQMARK$YESTERDAY%$SQLQORD | $MYSQL | tail -n 1` +MARK=`printf "$SQLQMARK" "$TODAY" | $MYSQL | tail -n 1` +LASTMARK=`printf "$SQLQMARK" "$YESTERDAY" | $MYSQL | tail -n 1` if [ -z "$MARK" ]; then echo "No benchmark records for $TODAY" @@ -44,62 +42,74 @@ if [ -z "$LASTMARK" ]; then fi #check for slowdown -CUR_TIME=`echo $SQLQTIME$MARK$SQLQGRMARK | $MYSQL` -OLD_TIME=`echo $SQLQTIME$LASTMARK$SQLQGRMARK | $MYSQL` +CUR_TIME=`printf "$SQLQTIME" "$MARK" | $MYSQL | tail -n 1` +OLD_TIME=`printf "$SQLQTIME" "$LASTMARK" | $MYSQL | tail -n 1` -if [ -z "$CUR_TIME" -o -z "$OLD_TIME"]; then +if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then cat < $TMP1 + printf "$SQLQFAIL" "$LASTMARK" | $MYSQL > $TMP2 + combine $TMP1 not $TMP2 > $TMP3 -if [ $CUR_FAIL -gt $OLD_FAIL ]; then cat <