Ignore:
Timestamp:
05/07/13 23:22:05 (11 years ago)
Author:
Daniela Dorner
Message:
write output of macro to logfile and catch return value, move to svn mars version, define dates according to hour
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Processing/FillNumEvts.sh

    r15393 r15516  
    77date >> $logfile
    88
    9 # get last 3, 6 or 9 nights
    10 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
    11 #        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
    12 #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    13         )
     9# get current hour
     10hour=`date +%k`
     11if [ $hour -le 7 ] || [ $hour -ge 19 ]
     12then
     13   dates=( `date +%Y/%m/%d --date="-12hour"` )
     14else
     15   # get last 3, 6 or 9 nights
     16   dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
     17   #        `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
     18   #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
     19           )
     20fi
     21
    1422#dates=( `find -L $auxdata -mindepth 3 -type d | sort -r | grep -v bad | sed "s/\${auxdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    1523
     
    1927echo  `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
    2028
    21 echo ${dates[@]}
     29#echo ${dates[@]}
    2230
    23 mars=/home/fact/Mars
     31mars=/home/fact/SW.automatic.processing/Mars.svn.2013.04.29
    2432cd $mars
    25 pwd
    26 # use macro from different mars version until versions are sorted out
    27 mars2=/home/fact/SW.automatic.processing/Mars.svn.2013.04.12
    2833
    2934# do filling of aux data
     
    3843   fi
    3944   
    40    echo "run numevts.C for night "$runnumber" (run-wise processing) "
     45   echo "run numevts.C for night "$runnumber" (run-wise processing) " >> $logfile 2>&1
    4146   printprocesslog "run numevts.C for night "$runnumber" (run-wise processing) "
    42    printprocesslog "root -q -b -l $mars2/fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\)"
    43    root -q -b -l $mars2/fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\)
     47   printprocesslog "root -q -b -l fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\)"
     48   check1=`root -q -b -l fact/processing/numevents.C\("\"$runnumber"\"\,"\"$anapath"\"\,"\"$resulttable1"\"\,kFALSE\,kFALSE\) | tee $logfile | intgrep`
     49
     50   case $check1 in
     51      1)   printprocesslog "INFO filling numevts.C was successfully (check1=$check1)"
     52           ;;
     53      0)   printprocesslog "WARN connection to DB failed in numevts.C (check1=$check1)"
     54           ;;
     55      *)   printprocesslog "ERROR numevts.C failed (check1=$check1)"
     56           ;;
     57   esac
    4458
    4559   #echo "run numevts.C for night "$runnumber" (night-wise processing) "
Note: See TracChangeset for help on using the changeset viewer.