From: Claudio Sacerdoti Coen Date: Mon, 31 Oct 2005 09:02:06 +0000 (+0000) Subject: Bugs fixed. X-Git-Tag: V_0_7_2_3~163 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=90726a9d315302213f1b0fae9e11a194a758a6e8;p=helm.git Bugs fixed. --- diff --git a/helm/matita/scripts/crontab.sh b/helm/matita/scripts/crontab.sh index ff475626a..84dc6a9ab 100644 --- a/helm/matita/scripts/crontab.sh +++ b/helm/matita/scripts/crontab.sh @@ -1,9 +1,7 @@ #!/bin/bash TODAY=`date +%Y%m%d0200` YESTERDAY=`date -d yesterday +%Y%m%d0200` -MARK=`echo "select distinct mark from bench where mark like '$TODAY%' order by mark" | mysql -u helm matita | tail -n 1` -LASTMARK=`echo "select distinct mark from bench where mark like '$YESTERDAY%' order by mark" | mysql -u helm matita | tail -n 1` -TMPDIRNAME=.__${MARK}_crontab +TMPDIRNAME=.__${TODAY}_crontab CVSROOT=":ext:$USER@marcello.cs.unibo.it:/home/faculty/PROJECTS/cvs/helm" SHELLTIME2CENTSPHP=helm/matita/scripts/shell_time2cents.php SHELLADDERPHP=helm/matita/scripts/shell_adder.php @@ -16,14 +14,22 @@ cd $TMPDIRNAME cvs -d $CVSROOT co helm/matita/scripts 1>/dev/null 2>/dev/null helm/matita/scripts/profile_cvs.sh 2> LOG -CUR_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$MARK\" group by mark;"` -OLD_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$LASTMARK\" group by mark;"` +MARK=`echo "select distinct mark from bench where mark like '$TODAY%' order by mark" | mysql -u helm matita | tail -n 1` +LASTMARK=`echo "select distinct mark from bench where mark like '$YESTERDAY%' order by mark" | mysql -u helm matita | tail -n 1` -if [ -z "$CUR_TIME" -o -z "$OLD_TIME" ]; then - echo "No benchamks records for $MARK" +if [ -z "$MARK" ]; then + echo "No benchmark records for $MARK" exit 1 fi +if [ -z "$LASTMARK" ]; then + echo "No benchmark records for $LASTMARK" + exit 1 +fi + +CUR_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$MARK\" group by mark;"` +OLD_TIME=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLADDERPHP -- $COMMONPHP "select SEC_TO_TIME(SUM(TIME_TO_SEC(time))) from bench where mark = \"$LASTMARK\" group by mark;"` + CUR_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $CUR_TIME` OLD_CENTS=`/usr/bin/php4 -c /etc/php4/apache/php.ini -f $SHELLTIME2CENTSPHP -- $COMMONPHP $OLD_TIME`