Index: trunk/DataCheck/FillAuxData.sh
===================================================================
--- trunk/DataCheck/FillAuxData.sh	(revision 12968)
+++ trunk/DataCheck/FillAuxData.sh	(revision 12969)
@@ -20,5 +20,13 @@
 # trigger rate has as first value -1, but with using the median it should be fine
 
-errlog=/home/fact/SW.automatic.processing/DataCheck/log/error.log
+# option 
+doupdate="yes" # update all entries (needed when new fields have been added)
+doupdate="no" # fill only entries which are not yet existing (default)
+
+source `dirname $0`/Sourcefile.sh
+printprocesslog "INFO starting $0 with option doupdate="$doupdate
+
+logfile=$runlogpath"/FillAuxLP-"$datetime".log"
+date >> $logfile
 
 function getfitsstatistics()
@@ -34,15 +42,15 @@
    max=
    tmpfile=`dirname $0`/`basename $1`.tmp
-   echo "ftcopy $1'[col Time]' - | ftstat - | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'" >> $errlog
-   timefromfile=`ftcopy $1'[col Time]' - 2>>$errlog | ftstat - 2>>$errlog | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'`
+   echo "ftcopy $1'[col Time]' - | ftstat - | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'" >> $logfile
+   timefromfile=`ftcopy $1'[col Time]' - 2>>$logfile | ftstat - 2>>$logfile | grep 'mean' | grep -E -o [0-9]+[.] | sed -e 's/[.]//g'`
    if [ $timefromfile -gt 30000 ]
    then 
-      echo "ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $errlog
+      echo "ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $logfile
       #ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -
-      ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - 2>>$errlog | ftcopy -'[col '${2}']' - 2>>$errlog | ftstat - 2>>$errlog > $tmpfile
-   else
-      echo "ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $errlog
+      ftcopy $1'[Time - 40587> '${3}' && Time - 40587< '${4}' ][col '${2}';Time]' - 2>>$logfile | ftcopy -'[col '${2}']' - 2>>$logfile | ftstat - 2>>$logfile > $tmpfile
+   else
+      echo "ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -" >> $logfile
       #ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - | ftcopy -'[col '${2}']' - | ftstat -
-      ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - 2>>$errlog | ftcopy -'[col '${2}']' - 2>>$errlog | ftstat - 2>>$errlog > $tmpfile
+      ftcopy $1'[Time> '${3}' && Time< '${4}' ][col '${2}';Time]' - 2>>$logfile | ftcopy -'[col '${2}']' - 2>>$logfile | ftstat - 2>>$logfile > $tmpfile
    fi
    good=`cat $tmpfile | grep 'good' | grep -E -o '[-]?[0-9]+[.]?[0-9]*'`
@@ -65,11 +73,4 @@
 }
 
-# option 
-doupdate="yes" # update all entries (needed when new fields have been added)
-doupdate="no" # fill only entries which are not yet existing (default)
-
-source `dirname $0`/Sourcefile.sh
-printprocesslog "INFO starting $0 with option doupdate="$doupdate
-
 # setup to use ftools
 source $HEADAS/headas-init.sh
@@ -93,9 +94,10 @@
 
 # get last 2 nights
-dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` )
+dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` )
 #dates=( `find $ziprawdata -mindepth 3 -type d | sort | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
 #echo ${dates[@]}
-dates=( "2012/02/21" "2012/02/20" "2012/02/19" "2012/02/18" )
+#dates=( "2012/02/21" "2012/02/20" "2012/02/19" "2012/02/18" )
 printprocesslog "INFO processing the following night(s): "${dates[@]}
+echo  `date`": processing the following night(s): "${dates[@]}
 
 # do filling of aux data 
@@ -178,4 +180,5 @@
    do
       printprocesslog "INFO processing file number "$runnumber"_"`printf %03d $filenum`
+      echo  `date`": processing file number "$runnumber"_"`printf %03d $filenum`
       # get information from rawfile
       rawfile=$ziprawdata/$date/$runnumber"_"`printf %03d $filenum`.fits.gz
