Index: /trunk/DataCheck/QuickLook/SendData.sh
===================================================================
--- /trunk/DataCheck/QuickLook/SendData.sh	(revision 18693)
+++ /trunk/DataCheck/QuickLook/SendData.sh	(revision 18694)
@@ -5,5 +5,5 @@
 printprocesslog "INFO starting $0"
 
-echo "Sent data"
+echo "Sent data."
 
 start=$1
@@ -17,4 +17,5 @@
 
 query="SELECT fSourceName FROM Source WHERE fSourceKey="$source
+#echo $query
 sourcename=`sendquery`
 
@@ -64,5 +65,5 @@
    getdbsetup
    printprocesslog "DEBUG sendquery QUERY: "$query
-   mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
+   mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "
 }
 
@@ -79,11 +80,11 @@
    mjd)  timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, "
          timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, "
-         break;;
+         ;;
    unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, "
          timeselect2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop, "
-         break;;
+         ;;
    *)    timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, "
          timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, "
-         break;;
+         ;;
 esac
 
@@ -120,5 +121,5 @@
 
 #printinfo | mail -a "From: dorner@astro.uni-wuerzburg.de" -s 'test downloading data ' -b dorner@astro.uni-wuerzburg.de $email
-printinfo | mail -s 'FACT data (test download)' -c dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
+printinfo | mail -s 'FACT data (test download)' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
 #printinfo
 
Index: /trunk/DataCheck/QuickLook/SendData_Internal.sh
===================================================================
--- /trunk/DataCheck/QuickLook/SendData_Internal.sh	(revision 18693)
+++ /trunk/DataCheck/QuickLook/SendData_Internal.sh	(revision 18694)
@@ -83,11 +83,11 @@
    printprocesslog "DEBUG sendquery QUERY: "$query
    echo "DEBUG sendquery QUERY: "$query
-   mysql -s -u $us --password=$pw --host=$ho $db -e " $query "
+   mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "
    if [ "$table" == "AnalysisResultsRunLP" ]
    then 
       query2=`echo $query | sed -e 's/AnalysisResultsRunLP/AnalysisResultsRunISDC/g'`
       echo "# QUERY: "$query2
-      mysql -s -u $us --password=$pw --host=$ho factdata_cp20150811 -e " $query2 "
-   fi
+      mysql $pwfile -s -u $us $pw --host=$ho factdata_cp20150811 -e " $query2 "
+      fi
 }
 
@@ -132,11 +132,11 @@
    mjd)  timeselect="Mjd(Min(fRunStart)) AS start, Mjd(MAX(fRunStop)) AS stop, "
          timeselect2=" Mjd(MIN(o.start)) AS start, Mjd(MAX(o.stop)) AS stop, "
-         break;;
+         ;;
    unix) timeselect="Unix_timestamp(CONVERT_TZ(Min(fRunStart), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(Max(fRunStop), '+00:00', 'SYSTEM')) AS stop, "
          timeselect2=" Unix_timestamp(CONVERT_TZ(MIN(o.start), '+00:00', 'SYSTEM')) AS start, Unix_timestamp(CONVERT_TZ(MAX(o.stop), '+00:00', 'SYSTEM')) AS stop, "
-         break;;
+         ;;
    *)    timeselect="MIN(fRunStart) AS start, MAX(fRunStop) AS stop, "
          timeselect2=" MIN(o.start) AS start, MAX(o.stop) as stop, "
-         break;;
+         ;;
 esac
 
@@ -155,4 +155,5 @@
    query="SELECT "$timeselect" SUM(fNumExcEvts)/SUM("$ontimeif")*3600 AS excrate, "
    query=$query" ExcErr(Sum(fNumSigEvts), SUM(fNumBgEvts))/SUM("$ontimeif")*3600 AS excerr, "
+   query=$query" SUM("$ontimeif"/60.) AS ontime, "
    query=$query" IF (SUM(fNumSigEvts)>10 AND SUM(fNumBgEvts)>10, LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)), IF (SUM(fNumSigEvts)-SUM(fNumBgEvts)>10, concat('(', LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)), ')'), '-')) AS significance, "
    query=$query" LiMa(SUM(fNumSigEvts), SUM(fNumBgEvts)) AS significance2, "
@@ -179,5 +180,5 @@
 #echo $query
 
-printinfo | mail -s 'test internal downloading data ' -c dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
+printinfo | mail -s 'test internal downloading data ' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
 #printinfo
 
Index: /trunk/DataCheck/Setup/setup.fact.lp.data
===================================================================
--- /trunk/DataCheck/Setup/setup.fact.lp.data	(revision 18693)
+++ /trunk/DataCheck/Setup/setup.fact.lp.data	(revision 18694)
@@ -53,6 +53,7 @@
 # dependencies of steps
 steps=$mars/resources/steps_fact.rc
-# file with db information
+# files with db information
 sqlrc=$mars/sql.rc
+sqlpw=/home/fact/.mysql.pw
 
 
Index: /trunk/DataCheck/Setup/setup.fact.lp.gate
===================================================================
--- /trunk/DataCheck/Setup/setup.fact.lp.gate	(revision 18693)
+++ /trunk/DataCheck/Setup/setup.fact.lp.gate	(revision 18694)
@@ -12,11 +12,23 @@
 # set only variables which are needed for the scripts running on this machine
 
+# software
+export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.26
+
 # logging and setup
-logpath=/users/fact/logs.automatic.processing/autologs
+user=`whoami`
+if [ "$user" == "www-data" ]
+then 
+   # processes called from the web
+   logpath=/home/factwww/logs.automatic.processing/autologs
+   # file with db information
+   sqlrc=/home/fact/sql.rc
+   sqlpw=/home/fact/.mysql.pw
+else
+   # normal processes called from the commandline or cron
+   logpath=/users/fact/logs.automatic.processing/autologs
+   # file with db information
+   sqlrc=$mars/sql.rc
+   sqlpw=/users/fact/.mysql.pw
+fi
 runlogpath=/users/fact/logs.automatic.processing/autologs
 
-export mars=/users/fact/SW.automatic.processing/Mars.svn.2014.05.26
-
-# file with db information
-sqlrc=$mars/sql.rc
-
Index: /trunk/DataCheck/Sourcefile.sh
===================================================================
--- /trunk/DataCheck/Sourcefile.sh	(revision 18693)
+++ /trunk/DataCheck/Sourcefile.sh	(revision 18694)
@@ -127,5 +127,5 @@
 # alias (we cannot check the beginning of the line due to
 # color codes in filldotraw.C)
-alias 'intgrep'='grep -E -o \\\(int\\\)[0-9]+$ | grep -E -o [0-9]+'
+alias 'intgrep'='grep -E -o \\\("(int|Bool_t)"\\\)[0-9]+$ | grep -E -o [0-9]+'
 
 
@@ -168,7 +168,12 @@
 {
    db=`grep Database $sqlrc | grep -v '#' | sed -e 's/Database: //' -e 's/ //g'`
-   pw=`grep Password $sqlrc | grep -v '#' | sed -e 's/Password: //' -e 's/ //g'`
+   pw="--password="`grep Password $sqlrc | grep -v '#' | sed -e 's/Password: //' -e 's/ //g'`
    us=`grep User $sqlrc | grep -v '#' | sed -e 's/User: //' -e 's/ //g'`
    ho=`grep URL $sqlrc | grep -v '#' | sed -e 's/ //g' -e 's/URL:mysql:\/\///'`
+   if [ "$sqlpw" != "" ]
+   then 
+      pwfile="--defaults-file=$sqlpw"
+      pw=""
+   fi
 #   echo "setup: "
 #   echo " db: "$db
@@ -183,5 +188,5 @@
    getdbsetup
    printprocesslog "DEBUG sendquery QUERY: "$query
-   if ! val=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "`
+   if ! val=`mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query "`
    then
       printprocesslog "ERROR could not query DB "$db" on host "$ho" with user "$us
@@ -341,5 +346,5 @@
    # execute query
    #numproc=`sendquery `#cannot be done with sendquery, because of row counting
-   if ! numproc=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query " | wc -l`
+   if ! numproc=`mysql $pwfile -s -u $us $pw --host=$ho $db -e " $query " | wc -l`
    then
       printprocesslog "ERROR could not query number of processes from db (program: $program, function getstatus)"
