Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:50

0001 #!/bin/bash
0002 #######     ------    beginning   --------  #######################
0003 RELEASE=CMSSW_3_5_4_DCS
0004 LOGFILE=/nfshome0/popcondev/SiStripJob/SiStripDCS.log
0005 DATEFILE=/nfshome0/popcondev/SiStripJob/SiStripDateDCS.log
0006 DATE=`date --utc`
0007 echo " " | tee -a $LOGFILE
0008 echo "----- new cronjob started for SiStrip  at -----" | tee -a $LOGFILE
0009 echo "$DATE" | tee -a $LOGFILE
0010 
0011 #######     ----     getting the previous cron date ############### 
0012 #######     parsing the last line from PopCon DATE log file###### 
0013 LOGDATE=`cat $DATEFILE | awk 'NR ==1 {print $0}'`
0014 TMSLOGDATE=`date --utc -d "$LOGDATE" +%s`
0015 echo "timestamp for the log (last log)" $TMSLOGDATE "corresponding to date" | tee -a $LOGFILE
0016 echo $LOGDATE | tee -a $LOGFILE
0017 rm -f $DATEFILE
0018 echo $DATE > $DATEFILE
0019 
0020 #setting up SCRAM environment
0021 source /nfshome0/cmssw2/scripts/setup.sh
0022 cd /nfshome0/popcondev/SiStripJob/${RELEASE}/src/
0023 eval `scramv1 runtime -sh`
0024 #showtags
0025 #echo ${TNS_ADMIN}
0026 
0027 YEAR=`date -u +%Y`
0028 MONTH=`date -u +%m`
0029 # Take the blank padded version of the day, otherwise it will start with a 0
0030 # for days before the 10th and it will crash the o2o.
0031 # DAY=`date -u +%d`
0032 DAY=`date -u +%e`
0033 # Remove leading whitespace if any
0034 DAY=`echo $DAY | tr -s " "`
0035 HOUR=`date -u +%H`
0036 
0037 RunDir=/nfshome0/popcondev/SiStripJob/${RELEASE}/src/CalibTracker/SiStripDCS/test/
0038 LogDir=${RunDir}/log
0039  
0040 echo $DAY.$MONTH.$YEAR $HOUR
0041 
0042 cd ${RunDir}
0043 
0044 # cat ${RunDir}/dcs_o2o_template_cfg.py | sed -e "s@YEAR@$YEAR@g" -e "s@MONTH@$MONTH@g" -e "s@DAY@$DAY@g" -e "s@HOUR@$HOUR@g" > ${RunDir}/dcs_o2o_$DAY$MONTH$YEAR\_$HOUR\_cfg.py
0045 cat ${RunDir}/dcs_o2o_template_cfg.py | sed -e "s@YEAR@$YEAR@g" -e "s@MONTH@$MONTH@g" -e "s@DAY@$DAY@g" -e "s@HOUR@$HOUR@g" > ${RunDir}/dcs_o2o_cfg.py
0046 
0047 python ${RunDir}/ManualO2OForAutomaticProcessing.py | tee -a $LOGFILE
0048 
0049 #cmsRun ${RunDir}/dcs_o2o_$DAY$MONTH$YEAR\_$HOUR\_cfg.py | tee -a $LOGFILE #${LogDir}/dcs_o2o_$DAY$MONTH$YEAR\_$HOUR.log 
0050 #mv info.log ${LogDir}/info/info_$DAY$MONTH$YEAR\_$HOUR.log
0051 #mv error.log ${LogDir}/error/error_$DAY$MONTH$YEAR\_$HOUR.log
0052 #mv warning.log ${LogDir}/warning/warning_$DAY$MONTH$YEAR\_$HOUR.log
0053 #mv debug.log ${LogDir}/debug/debug_$DAY$MONTH$YEAR\_$HOUR.log
0054 #rm dcs_o2o_$DAY$MONTH$YEAR\_$HOUR\_cfg.py