Ignore:
Timestamp:
09/06/13 16:08:40 (11 years ago)
Author:
Daniela Dorner
Message:
usage of getdates function, prepared script to be used in RunMoreNights.sh, added 4 new variables, cleanup
File:
1 edited

Legend:

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

    r15604 r17097  
    11#!/bin/bash
    22
    3 # option
    4 doupdate="yes" # update all entries (needed when new fields have been added)
    5 #doupdate="no" # fill only entries which are not yet existing (default)
    6 
     3# option whether to fill all row or only those where information is missing
     4# $doupdate might be given as environment variable
     5if [ "$doupdate" = "" ]
     6then
     7   doupdate="yes" # update all entries (needed when new fields have been added)
     8   doupdate="no" # fill only entries which are not yet existing (default)
     9fi
    710
    811source `dirname $0`/../Sourcefile.sh
     
    1114logfile=$runlogpath"/EffectiveOn-"$datetime".log"
    1215date >> $logfile
    13 
    14 echo $logfile
    1516
    1617# setup to use ftools
     
    2425fi
    2526
    26 
    27 # get last 3, 6 or 9 nights
    28 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \
    29         `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \
    30 #        `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \
    31         )
    32 dates=( `find -L $ziprawdata -mindepth 3 -type d | sort -r | sed "s/\${ziprawdata_for_sed}//g" | sed -e 's/^\///'` ) #all available dates in /loc_data/zipraw
    33 
    34 #dates=( "2012/11/19" )
     27# get dates
     28if [ "$certaindate" != "" ]
     29then
     30   getdates $certaindate
     31else
     32   # get all night
     33   #getdates "all"
     34   # get last 6 nights
     35   getdates 6
     36fi
     37
    3538
    3639printprocesslog "INFO processing the following night(s): "${dates[@]}
    3740echo  `date`": processing the following night(s): "${dates[@]} >> $logfile 2>&1
    38 
    39 echo ${dates[@]}
    4041
    4142cd $mars
     
    5152#      continue
    5253#   fi
     54#   echo $auxdir" @ "`date`
    5355
    5456   # check if aux files are available from that night
     
    7476   fi
    7577
    76    echo "run ontime.C for night "$runnumber
    7778   # get file numbers from DB
    7879   #   but only for not-corrupted files
     
    9192   fi
    9293
    93    #echo ${filenumbers[@]}
    9494   # fill auxiliary information for files
    9595   for filenum in ${filenumbers[@]}
     
    204204      query=$query" WHERE fNight="$runnumber" AND fRunID="$filenum
    205205
    206       echo $query
    207       #echo "EffectiveOn:${effectiveon[0]} # RMSEffectiveOn:${effectiveon[1]} # SumOnTime:${effectiveon[2]} # TriggerTimeOver125:${effectiveon[3]}"
    208206      #send query to DB
    209207      sendquery >/dev/null
Note: See TracChangeset for help on using the changeset viewer.