Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:55

0001 #!/bin/bash
0002 RELEASE=CMSSW_8_0_1
0003 RELEASE_DIR=/data/O2O/Ecal/cmssw
0004 DIR=/data/O2O/Ecal/TPG
0005 LOGFILE=${DIR}/EcalTriggerO2O.log
0006 DATEFILE=${DIR}/EcalTriggerO2ODate.log
0007 DATE=`date --utc`
0008 OUTFILE="/tmp/o2oUpdate_$$.txt"
0009 
0010 echo "*** Checking the environment for the job ***" | tee -a $LOGFILE
0011 set | tee -a $LOGFILE
0012 #setting up environment variables
0013 #export HOME=/nfshome0/popconpro
0014 export HOME=/nfshome0/ecaldb
0015 export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:/opt/ibutils/bin:/nfshome0/popconpro/bin
0016 echo "*** Checking the environment for the job ***" | tee -a $LOGFILE
0017 set | tee -a $LOGFILE
0018 
0019 function log() {
0020     echo "[`date`] : $@ " | tee -a $OUTFILE
0021 }
0022 
0023 function submit() {
0024     log $@
0025      $@ | tee -a -a $OUTFILE
0026 }
0027 
0028 JCPORT=9999
0029 
0030 while getopts ":t:r:p:k" options; do
0031     case $options in
0032         t ) TPG_KEY=$OPTARG;;
0033         r ) RUN_NUMBER=$OPTARG;;
0034         p ) JCPORT=$OPTARG;;
0035         k ) KILLSWITCH=1;;
0036     esac
0037 done
0038 
0039 log "-----------------------------------------------------------------------"
0040 log "${DIR}/updateO2O.sh"
0041 log "PID $$"
0042 log "HOSTNAME $HOSTNAME"
0043 log "JCPORT $JCPORT"
0044 log "TPG_KEY $TPG_KEY"
0045 log "RUN_NUMBER $RUN_NUMBER"
0046 log "date `date`"
0047 log "-----------------------------------------------------------------------"
0048 
0049 # CHANGE HERE
0050 #sleep 2
0051 #echo `date` > $OUTFILE
0052 #echo PID $$ >> $OUTFILE
0053 #echo USER `whoami` >> $OUTFILE
0054 #echo HOSTNAME $HOSTNAME >> $OUTFILE
0055 #echo TPG_KEY $TPG_KEY >> $OUTFILE
0056 #echo RUN_NUMBER $RUN_NUMBER >> $OUTFILE
0057 
0058 #######     ------  popcon  beginning   --------  #######################
0059 
0060 echo " " | tee -a $LOGFILE
0061 echo "----- new cronjob started for Ecal Trigger O2O at -----" | tee -a $LOGFILE
0062 echo "$DATE" | tee -a $LOGFILE
0063 
0064 #######     ----     getting the previous cron date ############### 
0065 #######     parsing the last line from PopCon DATE log file###### 
0066 LOGDATE=`cat $DATEFILE | awk 'NR ==1 {print $0}'`
0067 TMSLOGDATE=`date --utc -d "$LOGDATE" +%s`
0068 echo "timestamp for the log (last log)" $TMSLOGDATE "corresponding to date" | tee -a $LOGFILE
0069 echo $LOGDATE | tee -a $LOGFILE
0070 rm -f $DATEFILE
0071 echo $DATE > $DATEFILE
0072 
0073 
0074 pushd $RELEASE_DIR/$RELEASE/src/
0075 
0076 export SCRAM_ARCH=slc6_amd64_gcc493
0077 source /opt/offline/cmsset_default.sh
0078 eval `scramv1 runtime -sh` 
0079 
0080 pushd $DIR
0081 
0082 echo  "We are in: $PWD" | tee -a $LOGFILE
0083 
0084 echo "*** Checking the CMSSW environment for the job ***" | tee -a $LOGFILE
0085 set | tee -a $LOGFILE
0086 
0087 #- sdg: These cfg were in $RELEASE_DIR/$RELEASE/src/CondTools/Ecal/python
0088 #       but we keep them in this area in order to avoid issues with the release.
0089 submit cmsRun copyBadTT_cfg.py       
0090 submit cmsRun copyBadXT_cfg.py       
0091 submit cmsRun copyFgrGroup_cfg.py    
0092 submit cmsRun copyFgrIdMap_cfg.py    
0093 submit cmsRun copyFgrStripEE_cfg.py  
0094 submit cmsRun copyFgrTowerEE_cfg.py  
0095 submit cmsRun copyLin_cfg.py         
0096 submit cmsRun copyLutGroup_cfg.py    
0097 submit cmsRun copyLutIdMap_cfg.py    
0098 submit cmsRun copyPed_cfg.py         
0099 submit cmsRun copyPhysConst_cfg.py   
0100 submit cmsRun copySli_cfg.py         
0101 submit cmsRun copyWGroup_cfg.py      
0102 submit cmsRun copyWIdMap_cfg.py      
0103 submit cmsRun copySpikeTh_cfg.py
0104 submit cmsRun copyBadStrip_cfg.py
0105 submit cmsRun updateIntercali_express.py
0106 submit cmsRun updateIntercali_hlt.py
0107 submit cmsRun updateADCToGeV_express.py
0108 submit cmsRun updateADCToGeV_hlt.py
0109 
0110 
0111 # END OF CHANGES
0112 log "-----------------------------------------------------------------------"
0113 if [ -n "$KILLSWITCH" ]; then
0114     log "Killswitch activated"
0115 ADDR="http://$HOSTNAME:$JCPORT/urn:xdaq-application:service=jobcontrol/ProcKill?kill=$$"
0116 
0117 KILLCMD="curl $ADDR"
0118 
0119 log $KILLCMD
0120 $KILLCMD > /dev/null
0121 
0122 fi
0123 
0124 log DONE
0125 
0126 
0127 exit 0