Changeset 18213


Ignore:
Timestamp:
06/15/15 00:18:11 (9 years ago)
Author:
Daniela Dorner
Message:
updated script to run regularly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/DataCheck/PlotRatescans.sh

    r15519 r18213  
    44printprocesslog "INFO starting $0 $1"
    55
    6 # get current hour
    7 hour=`date +%k`
    8 
    9 # define dates depending on the time
    10 if [ $hour -lt 9 ] || [ $hour -gt 19 ]
     6# get dates
     7if [ "$certaindate" != "" ]
    118then
    12    # get current night
    13    dates=( `date +%Y/%m/%d --date="-12hour"` )
     9   checkstring=`echo $certaindate | grep -E -o '^20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]$'\|'^[0-9][0-9][0-9]$'`
     10   if [ "$checkstring" = "" ]
     11   then
     12      echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
     13      finish
     14   fi
     15   getdates $certaindate
    1416else
    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            )
     17   if [ "$1" = "" ]
     18   then
     19      # get last 6 nights if hour between 7 and 19h, else only current night
     20      getdates 3 7 19
     21   else
     22      getdates $1
     23   fi
    2024fi
    2125
    2226# for testing only
    23 anapath=/daq/analysis
     27anapath=/loc_data/analysis
    2428
    25 mars=/home/fact/SW.automatic.processing/Mars.svn.2013.04.29
    2629cd $mars
    27 
    2830
    2931for date in ${dates[@]}
     
    3234   makedir $outpath
    3335   date2=`echo $date | sed -e 's/\///g'`
    34    echo "root -q -b fact/plots/plotratescan.C\("\"$date2\""\) | tee $logfile | intgrep"
     36   logfile=$outpath/$date2.log
     37   printprocesslog "INFO root -q -b fact/plots/plotratescan.C\("\"$date2\""\) | tee $logfile | intgrep"
    3538   check1=`root -q -b fact/plots/plotratescan.C\("\"$date2\""\) | tee $logfile | intgrep`
    3639   
     
    4144           ;;
    4245   esac
    43 
    44    printprocesslog "INFO rsync output to gate."
    45    rsync -avn $anapath/ratescans/ gate:/home/factwww/ratescans
    4646done
    4747
Note: See TracChangeset for help on using the changeset viewer.