Index: trunk/DataCheck/Processing/FillAuxTemp.sh
===================================================================
--- trunk/DataCheck/Processing/FillAuxTemp.sh	(revision 17080)
+++ trunk/DataCheck/Processing/FillAuxTemp.sh	(revision 17081)
@@ -1,12 +1,16 @@
 #!/bin/bash
 
-# option 
-doupdate="yes" # update all entries (needed when new fields have been added)
-#doupdate="no" # fill only entries which are not yet existing (default)
+# option whether to fill all row or only those where information is missing
+# $doupdate might be given as environment variable
+if [ "$doupdate" = "" ]
+then
+   doupdate="yes" # update all entries (needed when new fields have been added)
+   doupdate="no" # fill only entries which are not yet existing (default)
+fi
 
 source `dirname $0`/../Sourcefile.sh
 printprocesslog "INFO starting $0 with option doupdate="$doupdate
 
-logfile=$runlogpath"/FillTemp-"$datetime".log"
+logfile=$runlogpath"/FillAuxTemp-"$datetime".log"
 date >> $logfile
 
@@ -21,15 +25,17 @@
 fi
 
-
-# get last 3, 6 or 9 nights
-dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
-#        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
-#        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
-        )
-dates=( `find -L $ziprawdata -mindepth 3 -type d | sort | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
+# get dates
+if [ "$certaindate" != "" ]
+then
+   getdates $certaindate
+else
+   # get all night
+   #getdates "all"
+   # get last 6 nights
+   getdates 6
+fi
+
 printprocesslog "INFO processing the following night(s): "${dates[@]}
 echo  `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
-
-echo ${dates[@]}
 
 cd $mars
@@ -151,6 +157,5 @@
       if [ -e $fsctempfile ] && [ $tempnumerrors -eq 0 ]
       then 
-         fsctemps=( `root -q -b -l fact/camtemp.C\("\"$fsctempfile\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
-         echo ${fsctemps[@]}
+         fsctemps=( `root -q -b -l fact/processing/camtemp.C\("\"$fsctempfile\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
          if [ "${fsctemps[0]}" == "" ]
          then 
@@ -181,5 +186,5 @@
       if [ -e $magicweatherfile ] && [ $weathernumerrors -eq 0 ]
       then 
-         mtemps=( `root -q -b -l fact/magictemp.C\("\"$magicweatherfile\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
+         mtemps=( `root -q -b -l fact/processing/magictemp.C\("\"$magicweatherfile\""\,$tstart\,$tstop\) | grep "result" | grep -E -o '[0-9]+[.]?[0-9]*'` )
          if [ "${mtemps[0]}" == "" ]
          then 
@@ -202,5 +207,4 @@
       query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
       
-      echo $query
       # send query to DB
       sendquery >/dev/null
