Index: trunk/DataCheck/DataCheck/PlotQuality.sh
===================================================================
--- trunk/DataCheck/DataCheck/PlotQuality.sh	(revision 17588)
+++ trunk/DataCheck/DataCheck/PlotQuality.sh	(revision 17589)
@@ -3,7 +3,4 @@
 source `dirname $0`/../Sourcefile.sh
 printprocesslog "INFO starting $0 $1"
-
-# get current hour
-hour=`date +%k`
 
 # get dates
@@ -29,4 +26,5 @@
 for date in ${dates[@]}
 do 
+   #echo $date
    outpath=$anapath/quality/$date
    logfile=$anapath/quality/$date/quality.log
@@ -36,5 +34,5 @@
    day=`echo $date | cut -d/ -f3 | sed -e 's/^0//g'`
    printprocesslog "DEBUG root -q -b fact/plots/quality.C\("$year"\,"$month"\,"$day"\,\""$outpath"\"\) | tee $logfile | intgrep"
-   check1=`root -q -b fact/plots/quality.C\($year\,$month\,$day\,\""$outpath"\"\) | tee $logfile | intgrep`
+   check1=`root -q -b fact/plots/quality.C\($year\,$month\,$day\,\""$outpath"\"\) 2>&1 | tee $logfile | intgrep`
    
    case $check1 in
@@ -46,5 +44,9 @@
 
    printprocesslog "INFO rsync output to gate."
-   rsync -av $anapath/quality/ gate:/home/factwww/quality
+   if ! rsync -av $anapath/quality/ gate:/home/factwww/quality >> $logfile 2>&1
+   then 
+      printprocesslog "ERROR rsync to gate failed."
+      echo `date +%F\ %T`" ERROR rsync to gate failed."
+   fi
 done
 
