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