File indexing completed on 2024-04-06 12:06:26
0001
0002
0003 WebDir='/eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring'
0004 WebSite='https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring'
0005 HistoDir='/eos/cms/store/group/dpg_hcal/comm_hcal/www/HcalRemoteMonitoring/CMT/histos'
0006
0007
0008 cmsenv 2>/dev/null
0009 if [ $? == 0 ] ; then
0010 eval `scramv1 runtime -sh`
0011 fi
0012
0013
0014
0015 fileName=$1
0016
0017
0018 runList=""
0019 if [ ${
0020 if [ -s ${fileName} ] ; then
0021 runList=`cat ${fileName}`
0022 else
0023 echo "<${fileName}> does not seem to be a valid file"
0024 exit 2
0025 fi
0026 else
0027 if [ ${ignoreFile} -eq 0 ] ; then
0028 echo " ! no file provided"
0029 fi
0030 echo " ! will produce only the global html page"
0031 fi
0032
0033
0034
0035
0036 runList=`echo "${runList}" | sed 'sk,k\ kg' | sed 'sk;k\ kg'`
0037 ok=1
0038 for r in ${runList} ; do
0039 if [ ! ${
0040 echo "run numbers are expected to be of length 6. Check <$r>"
0041 ok=0
0042 fi
0043 debug_loc=0
0044 if [ "$r" -eq "$r" ] 2>/dev/null ; then
0045 if [ ${debug_loc} -eq 1 ] ; then echo "run variable <$r> is a number (ok)"; fi
0046 else
0047 echo "error: run variable <$r> is not an integer number"
0048 ok=0
0049 fi
0050 done
0051
0052 echo "Tested `wc -w <<< "${runList}"` runs from file ${fileName}"
0053 if [ ${ok} -eq 0 ] ; then
0054 echo "errors in the file ${fileName} with run numbers"
0055 exit 3
0056 else
0057 if [ ${
0058 echo "run numbers in ${fileName} verified ok"
0059 fi
0060 fi
0061
0062 echo
0063 echo
0064 echo 'Numbers of NEW runs for processing'
0065 echo "${runList}"
0066 echo -e "runList complete\n"
0067
0068 echo -e '\n\nRun numbers:'
0069 runListEOS=`echo $runList | tee _runlist_`
0070 echo "${runListEOS}"
0071 echo -e "Full runList for EOS complete\n"
0072
0073
0074
0075 echo 'next message is Fine: '
0076 rm index.html
0077 eoscp $WebDir/CMT/index.html index.html
0078 cp index.html OLDindex.html
0079
0080
0081 cat index.html | head -n -1 > index_draft.html
0082
0083
0084
0085
0086
0087
0088
0089 k=2
0090
0091
0092
0093 echo ' ================>>> k in old list = '$k
0094
0095 for i in ${runListEOS} ; do
0096
0097
0098
0099 runnumber=${i}
0100
0101 let "k = k + 1"
0102 echo
0103 echo ' ================>>> new k in loop = '$k
0104 echo
0105 echo
0106 echo 'RUN number = '$runnumber
0107
0108
0109 dasInfo=${DAS_DIR}/das_${runnumber}.txt
0110 got=0
0111 if [ ${dasCache} -eq 1 ] ; then
0112 rm -f tmp
0113 if [ -s ${dasInfo} ] ; then
0114 cp ${dasInfo} tmp
0115 got=1
0116 else
0117 echo "no ${dasInfo} found. Will use dasgoclient"
0118 fi
0119 fi
0120
0121 if [ ${got} -eq 0 ] ; then
0122
0123 dasgoclient --query="file dataset=/HIHcalNZS/HIRun2018A-v1/RAW run=${i} | grep file.size, file.nevents, file.modification_time " > tmp
0124 fi
0125
0126
0127 timetmp=`cat tmp | head -n 1 | awk '{print $3}'`
0128
0129 type='ZeroBias'
0130 timetmp2=`date -d @${timetmp} +%Y-%m-%d:%H-%M-%S`
0131 sizetmp=`cat tmp | head -n 1 | awk '{print $1}'`
0132 neventstmp=`cat tmp | head -n 1 | awk '{print $2}'`
0133 commentariy='era HI test'
0134
0135 echo 'RUN Type = '$type
0136 echo ${sizetmp} ${neventstmp} ${timetmp2}
0137 echo 'RUN Comment = '$commentariy
0138
0139
0140
0141
0142 let "raw = (k % 2) + 2"
0143 echo '<tr>'>> index_draft.html
0144 echo '<td class="s1" align="center">'$k'</td>'>> index_draft.html
0145 echo '<td class="s'$raw'" align="center">'$runnumber'</td>'>> index_draft.html
0146 echo '<td class="s'$raw'" align="center">'$type'</td>'>> index_draft.html
0147 echo '<td class="s'$raw'" align="center">'$timetmp2'</td>'>> index_draft.html
0148 echo '<td class="s'$raw'" align="center">'$sizetmp'</td>'>> index_draft.html
0149 echo '<td class="s'$raw'" align="center">'$neventstmp'</td>'>> index_draft.html
0150 echo '<td class="s'$raw'" align="center"><a href="'$WebSite'/CMT/GLOBAL_'$runnumber'/LumiList.html">CMT_'$runnumber'</a></td>'>> index_draft.html
0151 echo '<td class="s'$raw'" align="center"><a href="'$WebSite'/GlobalRMT/GLOBAL_'$runnumber'/MAP.html">RMT_'$runnumber'</a></td>'>> index_draft.html
0152 echo '<td class="s'$raw'" align="center">'$commentariy'</td>'>> index_draft.html
0153
0154
0155 rm tmp
0156
0157
0158
0159 if [ ${
0160
0161 temp_var=${runList/${runnumber}/}
0162 if [ ${
0163 echo "adding a commentary for this run"
0164 echo "<td class=\"s${raw}\" align=\"center\">${comment}</td>" >> index_draft.html
0165 fi
0166 fi
0167 echo '</tr>'>> index_draft.html
0168 prev=$i
0169
0170
0171 done
0172
0173
0174
0175 echo `cat footer.txt`>> index_draft.html
0176
0177
0178 status=0
0179 if [ ${debug} -gt 0 ] ; then
0180 echo "debug=${debug}. No upload to eos"
0181 status=-1
0182 else
0183
0184
0185
0186 status="$?"
0187
0188 fi
0189
0190
0191
0192 if [ ${debug} -eq 0 ] ; then
0193
0194 rm -f _runlist_
0195 rm -f _runlistEOSall_
0196 fi
0197
0198
0199 if [[ "${status}" == "0" ]]; then
0200 echo "Successfully uploaded!"
0201 else
0202 echo "ERROR: Uploading failed"
0203 exit 1
0204 fi
0205
0206 echo "index script done"