1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # This script checks whether data can be deleted
|
---|
4 | #
|
---|
5 |
|
---|
6 | source `dirname $0`/../Sourcefile.sh
|
---|
7 | printprocesslog "INFO starting $0"
|
---|
8 |
|
---|
9 | numchecktransfer=`/usr/sbin/lsof $0 | grep -o -c $0`
|
---|
10 | if [ $numchecktransfer -gt 1 ]
|
---|
11 | then
|
---|
12 | printprocesslog "INFO "$0" already running -> exit. "
|
---|
13 | echo "INFO "$0" already running -> exit. "
|
---|
14 | finish
|
---|
15 | fi
|
---|
16 |
|
---|
17 | logfile2=$logpath"/transfer/CheckTransfer.log"
|
---|
18 | date > $logfile2 2>&1
|
---|
19 |
|
---|
20 | diskusage=( `ssh fact@161.72.93.131 "df -P /daq" | grep daq ` )
|
---|
21 | # check if more than X GB are left on /daq
|
---|
22 | if [ ${diskusage[3]} -lt 700000 ]
|
---|
23 | then
|
---|
24 | printprocesslog "DISK less than 700 GB left on /daq ("${diskusage[3]}")"
|
---|
25 | echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")"
|
---|
26 | echo "WARN less than 700 GB left on /daq ("${diskusage[3]}")" >> $logfile2 2>&1
|
---|
27 | sendemail="yes"
|
---|
28 | fi
|
---|
29 |
|
---|
30 | diskusage2=( `df -P /scratch | grep scratch ` )
|
---|
31 | # check if more than X GB are left on /scratch
|
---|
32 | if [ ${diskusage2[3]} -lt 500000 ]
|
---|
33 | then
|
---|
34 | printprocesslog "DISK less than 500 GB left on /scratch ("${diskusage2[3]}")"
|
---|
35 | echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")"
|
---|
36 | echo "WARN less than 500 GB left on /scratch "${diskusage2[3]}")" >> $logfile2 2>&1
|
---|
37 | sendemail="yes"
|
---|
38 | fi
|
---|
39 |
|
---|
40 | # needed for transfer to phido
|
---|
41 | #source /home_nfs/isdc/fact_opr/myagent.sh
|
---|
42 |
|
---|
43 | # check first the disk in LP and on dl00
|
---|
44 | ssh fact@161.72.93.131 "df -h /*da*"
|
---|
45 | df -h /scratch
|
---|
46 | echo ""
|
---|
47 | echo "" >> $logfile2 2>&1
|
---|
48 |
|
---|
49 | # check next the DB to know if some transfer processes failed or crashed
|
---|
50 | function check_runs_in_db()
|
---|
51 | {
|
---|
52 | query="SELECT "$toquery" FROM "$1" "$where
|
---|
53 | #echo $query
|
---|
54 | runs=( `sendquery $query` )
|
---|
55 | if [ ${#runs[@]} -gt 0 ]
|
---|
56 | then
|
---|
57 | #for run in ${runs[@]}
|
---|
58 | #do
|
---|
59 | # echo $run
|
---|
60 | #done
|
---|
61 | sendemail="yes"
|
---|
62 | echo -e "\e[1;31m\x1b[5m ==>\e[00m "$1": "${runs[@]}"\e[1;31m\x1b[5m <==\e[00m "
|
---|
63 | echo "SELECT fNight, fRunId, fStartTime, fStopTime, fReturnCode FROM "$1" "$where";"
|
---|
64 | echo "UPDATE "$1" SET fStartTime=NULL, fStopTime=NULL, fAvailable=NULL, fReturnCode=NULL, fProcessingSiteKey=NULL "$where";"
|
---|
65 | echo -e " ==> "$1": "${runs[@]}" <== " >> $logfile2 2>&1
|
---|
66 | echo "---> Please check the DB and reset the processes if needed. " >> $logfile2 2>&1
|
---|
67 | echo "to check: SELECT fNight, fRunId, fStartTime, fStopTime, fReturnCode FROM "$1" "$where";" >> $logfile2 2>&1
|
---|
68 | echo "to reset: UPDATE "$1" SET fStartTime=NULL, fStopTime=NULL, fAvailable=NULL, fReturnCode=NULL, fProcessingSiteKey=NULL "$where";" >> $logfile2 2>&1
|
---|
69 | fi
|
---|
70 | }
|
---|
71 | # get information of runs where transfer had a problem
|
---|
72 | toquery="fNight, fRunID, fStartTime, fStopTime, fAvailable, fProcessingSiteKey, fReturnCode "
|
---|
73 | toquery="CONCAT(fNight, '_', fRunID, '(', fStartTime, '-', fStopTime, ':', fReturnCode, ')') "
|
---|
74 | toquery="CONCAT(fNight, '_', fRunID, ':', fReturnCode) "
|
---|
75 | toquery="IF (ISNULL(fReturnCode), CONCAT(fNight, '_', fRunID, 'crashed'), CONCAT(fNight, '_', fRunID, 'failed', fReturnCode)) "
|
---|
76 | where="WHERE NOT ISNULL(fReturnCode) OR (NOT ISNULL(fStartTime) AND ISNULL(fStopTime)) AND fStartTime < DATE_ADD(Now(), INTERVAL -5 HOUR) "
|
---|
77 | check_runs_in_db "RawFileRsyncedISDCStatus"
|
---|
78 | check_runs_in_db "RawFileAvailWueStatus"
|
---|
79 | # RawFileAvailISDC needs a different treatment
|
---|
80 | # as return code 0 means that file is in fails folder in archive
|
---|
81 | where="WHERE fReturnCode>0 OR (NOT ISNULL(fStartTime) AND ISNULL(fStopTime)) AND fStartTime < DATE_ADD(Now(), INTERVAL -1 HOUR) "
|
---|
82 | check_runs_in_db "RawFileAvailISDCStatus"
|
---|
83 |
|
---|
84 | # get nights from directory in LP
|
---|
85 | dates=( `ssh fact@161.72.93.131 "find /loc_data/zipraw -mindepth 3 -type d | sort | sed -e 's/\/loc_data\/zipraw\///g' "` )
|
---|
86 |
|
---|
87 | numdaysok=0
|
---|
88 | numdaysoklimit=10
|
---|
89 | sumdata=0
|
---|
90 | checklimit=5000
|
---|
91 | for date in ${dates[@]}
|
---|
92 | do
|
---|
93 | logfile=$logpath"/transfer/CheckTransfer_"`echo $date | sed -e 's/\//-/g'`".log"
|
---|
94 |
|
---|
95 | echo ""
|
---|
96 | echo "" >> $logfile2 2>&1
|
---|
97 | echo "Processing "$date" ..."
|
---|
98 | echo "Processing "$date" ..." >> $logfile2 2>&1
|
---|
99 |
|
---|
100 | # avoid that already checked days are checked again
|
---|
101 | if grep "EVERYTHING" $logfile >/dev/null
|
---|
102 | then
|
---|
103 | echo " "$date" has been checked already and is fine. Please check logfile "$logfile
|
---|
104 | echo " "$date" has been checked already and is fine. Please check logfile "$logfile >> $logfile2 2>&1
|
---|
105 | sendemail="yes"
|
---|
106 | continue
|
---|
107 | fi
|
---|
108 | if [ "$certaindate" != "" ]
|
---|
109 | then
|
---|
110 | checkstring=`echo $certaindate | grep -E -o '^20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]$'`
|
---|
111 | if [ "$checkstring" = "" ]
|
---|
112 | then
|
---|
113 | echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
|
---|
114 | finish
|
---|
115 | fi
|
---|
116 | if [ "$certaindate" != "$date" ]
|
---|
117 | then
|
---|
118 | printprocesslog "INFO continue, as certaindate has been set to "$certaindate
|
---|
119 | echo " continue, as certaindate has been set to "$certaindate
|
---|
120 | continue
|
---|
121 | fi
|
---|
122 | fi
|
---|
123 |
|
---|
124 | # some counters
|
---|
125 | numdiff=0
|
---|
126 | numok=0
|
---|
127 | numpb=0
|
---|
128 |
|
---|
129 | # check always only $numdaysoklimit days
|
---|
130 | # and require at least $checklimit GB that have been checked
|
---|
131 | # remark: bc: expr1 < expr2: the result is 1 if expr1 is strictly less than expr2
|
---|
132 | if [ $numdaysok -ge $numdaysoklimit ] && [ $(echo " $sumdata > $checklimit " | bc -l) -eq 1 ]
|
---|
133 | then
|
---|
134 | printprocesslog "INFO more than "$numdaysoklimit" ok and more than "$checklimit" GB checked. "
|
---|
135 | continue
|
---|
136 | fi
|
---|
137 |
|
---|
138 | # get paths
|
---|
139 | date2=`echo $date | sed -e 's/\///g'`
|
---|
140 | # lprawpath="/daq/raw/"$date
|
---|
141 | lprawpath="/newdaq/raw/"$date
|
---|
142 | # lprawpath2="/loc_data/raw/"$date
|
---|
143 | lprawpath2="/daq/raw/"$date
|
---|
144 | lpziprawpath="/loc_data/zipraw/"$date
|
---|
145 | localrawpath="/scratch/from_lapalma/raw/"$date
|
---|
146 | localrawpath3="/fact/raw/"$date
|
---|
147 | # localfailpath="/archive/fact/fails/raw/"$date
|
---|
148 | localfailpath="/gpfs/fact/fact-archive/fails/raw/"$date
|
---|
149 | wuerawpath="/fact/raw/"$date
|
---|
150 | qlapath="/daq/analysis/callisto/"$date
|
---|
151 | #phidorawpath="/fhgfs/groups/app/fact-construction/raw/"$date
|
---|
152 |
|
---|
153 | # get disk usage and number of files for directory
|
---|
154 | newdaq=( `ssh fact@161.72.93.131 "if [ -d $lprawpath ]; then ls $lprawpath/* | wc -l; du -s -b --apparent-size $lprawpath; else echo '-1 -1 -1'; fi"` )
|
---|
155 | daq=( `ssh fact@161.72.93.131 "if [ -d $lprawpath2 ]; then ls $lprawpath2/* | wc -l; du -s -b --apparent-size $lprawpath2; else echo '-1 -1 -1'; fi"` )
|
---|
156 | if [ ${newdaq[0]} -eq -1 ] && [ ${daq[0]} -eq -1 ]
|
---|
157 | then
|
---|
158 | printprocesslog "INFO no data available on newdaq for "$date
|
---|
159 | echo "INFO no data available on newdaq for "$date >> $logfile 2>&1
|
---|
160 | continue
|
---|
161 | fi
|
---|
162 | zip=( `ssh fact@161.72.93.131 "if [ -d $lpziprawpath ]; then ls $lpziprawpath/* 2>/dev/null | wc -l; du -s -b --apparent-size $lpziprawpath; else echo '-1 -1 -1'; fi"` )
|
---|
163 | dl00=( `if [ -d $localrawpath ]; then ls $localrawpath/* | wc -l; du -s -b --apparent-size $localrawpath; else echo '-1 -1 -1'; fi` )
|
---|
164 | archive=( `if [ -d $localrawpath3 ]; then ls $localrawpath3/* 2>/dev/null | wc -l; du -L -s -b --apparent-size $localrawpath3; else echo '-1 -1 -1'; fi` )
|
---|
165 | fails=( `if [ -d $localfailpath ]; then ls $localfailpath/* | wc -l; du -L -s -b --apparent-size $localfailpath; else echo '-1 -1 -1'; fi` )
|
---|
166 | wue=( `ssh operator@coma.astro.uni-wuerzburg.de "if [ -d $wuerawpath ]; then ls $wuerawpath/* | wc -l; du -s -b --apparent-size $wuerawpath; else echo '-1 -1 -1'; fi"` )
|
---|
167 | #phido=( `ssh -i /home_nfs/isdc/fact_opr/.ssh/id_rsa.fact_opr.phido 129.217.160.201 "if [ -d $phidorawpath ]; then ls $phidorawpath/* | wc -l; du -s -b --apparent-size $phidorawpath; else echo '-1 -1 -1'; fi"` )
|
---|
168 | qla=( `ssh fact@161.72.93.131 "ls $qlapath/20*_C.root 2>/dev/null | wc -l"` )
|
---|
169 | query="SELECT Sum(if(fHasDrsFile=1,2,1)) FROM RunInfo WHERE fNight="$date2
|
---|
170 | querystart="SELECT Sum(if(fHasDrsFile=1,2,1)) FROM "
|
---|
171 | queryjoin="LEFT JOIN RunInfo USING(fNight,fRunID) "
|
---|
172 | querywhere="WHERE fNight="$date2" AND NOT ISNULL(fStartTime) AND NOT ISNULL(fStopTime) AND ISNULL(fReturnCode)"
|
---|
173 | numruns=`sendquery`
|
---|
174 | if [ "$numruns" == "" ]
|
---|
175 | then
|
---|
176 | numruns=0
|
---|
177 | fi
|
---|
178 | query=$querystart"RawFileRsyncedISDCStatus "$queryjoin" "$querywhere
|
---|
179 | numrsynced=`sendquery`
|
---|
180 | if [ "$numrsynced" == "" ]
|
---|
181 | then
|
---|
182 | numrsynced=0
|
---|
183 | fi
|
---|
184 | query=$querystart"RawFileAvailISDCStatus "$queryjoin" "$querywhere
|
---|
185 | numisdc=`sendquery`
|
---|
186 | if [ "$numisdc" == "" ]
|
---|
187 | then
|
---|
188 | numisdc=0
|
---|
189 | fi
|
---|
190 | query=$querystart"RawFileAvailWueStatus "$queryjoin" "$querywhere
|
---|
191 | numwue=`sendquery`
|
---|
192 | if [ "$numwue" == "" ]
|
---|
193 | then
|
---|
194 | numwue=0
|
---|
195 | fi
|
---|
196 | #query=$querystart"RawFileAvailPhidoStatus "$queryjoin" "$querywhere
|
---|
197 | #numphido=`sendquery`
|
---|
198 | #if [ "$numphido" == "" ]
|
---|
199 | #then
|
---|
200 | # numphido=0
|
---|
201 | #fi
|
---|
202 |
|
---|
203 | # select number of data runs
|
---|
204 | query="SELECT COUNT(*) FROM RunInfo WHERE fNight="$date2
|
---|
205 | query=$query" AND fRunTypeKey=1"
|
---|
206 | numdatruns=`sendquery`
|
---|
207 |
|
---|
208 | printprocesslog "disk: "
|
---|
209 | printprocesslog " newdaq "${newdaq[@]}
|
---|
210 | printprocesslog " daq "${daq[@]}
|
---|
211 | printprocesslog " data "${zip[@]}
|
---|
212 | printprocesslog " dl00 "${dl00[@]}
|
---|
213 | printprocesslog " wue "${wue[@]}
|
---|
214 | printprocesslog " arch "${archive[@]}
|
---|
215 | printprocesslog " fail "${fails[@]}
|
---|
216 | #printprocesslog " phido "${phido[@]}
|
---|
217 | printprocesslog " qla "${qla[@]}
|
---|
218 | printprocesslog "db: "
|
---|
219 | printprocesslog " runinfo "$numruns
|
---|
220 | printprocesslog " rsynced "$numrsynced
|
---|
221 | printprocesslog " isdc "$numisdc
|
---|
222 | printprocesslog " wue "$numwue
|
---|
223 | #printprocesslog " phido "$numphido
|
---|
224 | printprocesslog " data "$numdatruns
|
---|
225 | echo "disk: " >> $logfile 2>&1
|
---|
226 | echo " newdaq "${newdaq[@]} >> $logfile 2>&1
|
---|
227 | echo " daq "${daq[@]} >> $logfile 2>&1
|
---|
228 | echo " data "${zip[@]} >> $logfile 2>&1
|
---|
229 | echo " dl00 "${dl00[@]} >> $logfile 2>&1
|
---|
230 | echo " wue "${wue[@]} >> $logfile 2>&1
|
---|
231 | echo " arch "${archive[@]} >> $logfile 2>&1
|
---|
232 | echo " fail "${fails[@]} >> $logfile 2>&1
|
---|
233 | #echo " phido "${phido[@]} >> $logfile 2>&1
|
---|
234 | echo " qla "${qla[@]} >> $logfile 2>&1
|
---|
235 | echo "db: " >> $logfile 2>&1
|
---|
236 | echo " runinfo "$numruns >> $logfile 2>&1
|
---|
237 | echo " rsynced "$numrsynced >> $logfile 2>&1
|
---|
238 | echo " isdc "$numisdc >> $logfile 2>&1
|
---|
239 | echo " wue "$numwue >> $logfile 2>&1
|
---|
240 | #echo " phido "$numphido >> $logfile 2>&1
|
---|
241 | echo " datruns "$numdatruns >> $logfile 2>&1
|
---|
242 |
|
---|
243 | if ! [ $numdatruns -eq $qla ]
|
---|
244 | then
|
---|
245 | printprocesslog "WARN not all data runs are processed yet by the QLA for "$date"."
|
---|
246 | echo "WARN not all data runs are processed yet by the QLA for "$date >> $logfile 2>&1
|
---|
247 | result1="1-"
|
---|
248 | else
|
---|
249 | result1="0-"
|
---|
250 | fi
|
---|
251 | # check if file are available in the different places
|
---|
252 | if [ ${dl00[0]} -eq -1 ] && [ $date2 -lt 20120308 ]
|
---|
253 | then
|
---|
254 | printprocesslog "INFO data not available on /scratch on dl00 for "$date
|
---|
255 | echo "INFO data not available on /scratch on dl00 for "$date >> $logfile 2>&1
|
---|
256 | fi
|
---|
257 | if [ ${archive[0]} -eq -1 ]
|
---|
258 | then
|
---|
259 | printprocesslog "INFO data not in archive for "$date
|
---|
260 | echo "INFO data not in archive for "$date >> $logfile 2>&1
|
---|
261 | fi
|
---|
262 |
|
---|
263 | # check if number of files agree in the different places
|
---|
264 | # lp
|
---|
265 | if ! [ ${daq[0]} -eq -1 ] && ! [ ${daq[0]} -eq ${newdaq[0]} ]
|
---|
266 | then
|
---|
267 | printprocesslog "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date
|
---|
268 | echo "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date >> $logfile 2>&1
|
---|
269 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
270 | result1=$result1"1"
|
---|
271 | else
|
---|
272 | numok=`echo " $numok + 1 " | bc -l `
|
---|
273 | result1=$result1"0"
|
---|
274 | fi
|
---|
275 | # dl00
|
---|
276 | #if ! [ ${dl00[0]} -eq -1 ] && ! [ ${dl00[0]} -eq ${newdaq[0]} ]
|
---|
277 | if ! [ ${dl00[0]} -eq ${newdaq[0]} ]
|
---|
278 | then
|
---|
279 | printprocesslog "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
280 | echo "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1
|
---|
281 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
282 | result1=$result1"1"
|
---|
283 | else
|
---|
284 | numok=`echo " $numok + 1 " | bc -l `
|
---|
285 | result1=$result1"0"
|
---|
286 | fi
|
---|
287 | # archive
|
---|
288 | if ! [ ${archive[0]} -eq -1 ] && ! [ ${archive[0]} -eq ${newdaq[0]} ]
|
---|
289 | then
|
---|
290 | printprocesslog "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
291 | echo "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1
|
---|
292 | #check /archive/rev_1/failed
|
---|
293 | if ! [ ${fails[0]} -eq -1 ]
|
---|
294 | then
|
---|
295 | sum=`echo " ${fails[0]} + ${archive[0]} " | bc -l `
|
---|
296 | if ! [ $sum -eq ${newdaq[0]} ]
|
---|
297 | then
|
---|
298 | printprocesslog "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")."
|
---|
299 | echo "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")." >> $logfile 2>&1
|
---|
300 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
301 | result1=$result1"1"
|
---|
302 | else
|
---|
303 | numok=`echo " $numok + 1 " | bc -l `
|
---|
304 | result1=$result1"0"
|
---|
305 | fi
|
---|
306 | else
|
---|
307 | result1=$result1"1"
|
---|
308 | fi
|
---|
309 | else
|
---|
310 | if [ ${archive[0]} -eq -1 ]
|
---|
311 | then
|
---|
312 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
313 | result1=$result1"1"
|
---|
314 | else
|
---|
315 | numok=`echo " $numok + 1 " | bc -l `
|
---|
316 | result1=$result1"0"
|
---|
317 | fi
|
---|
318 | fi
|
---|
319 | # wue
|
---|
320 | #if ! [ ${wue[0]} -eq -1 ] && ! [ ${wue[0]} -eq ${newdaq[0]} ]
|
---|
321 | if ! [ ${wue[0]} -eq ${newdaq[0]} ]
|
---|
322 | then
|
---|
323 | printprocesslog "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
324 | echo "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1
|
---|
325 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
326 | result1=$result1"1"
|
---|
327 | else
|
---|
328 | numok=`echo " $numok + 1 " | bc -l `
|
---|
329 | result1=$result1"0"
|
---|
330 | fi
|
---|
331 | ## phido
|
---|
332 | #if ! [ ${phido[0]} -eq -1 ] && ! [ ${phido[0]} -eq ${newdaq[0]} ]
|
---|
333 | #then
|
---|
334 | # printprocesslog "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
335 | # echo "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date >> $logfile 2>&1
|
---|
336 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
337 | # result1=$result1"1"
|
---|
338 | #else
|
---|
339 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
340 | # result1=$result1"0"
|
---|
341 | #fi
|
---|
342 |
|
---|
343 | short2=
|
---|
344 | if [ "$result1" != "0-0000" ] && [ "$short" != "no" ]
|
---|
345 | then
|
---|
346 | short2="yes"
|
---|
347 | fi
|
---|
348 |
|
---|
349 | if [ "$short2" = "yes" ]
|
---|
350 | then
|
---|
351 | printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking."
|
---|
352 | echo "" >> $logfile 2>&1
|
---|
353 | echo "number of files does not yet agree in all sites ("$result1") -> do no further checking." >> $logfile 2>&1
|
---|
354 | echo "" >> $logfile 2>&1
|
---|
355 | # print to console
|
---|
356 | echo "SUMMARY for "$date
|
---|
357 | echo "-----------------------"
|
---|
358 | echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) "${qla[@]}" (qla) "$numdatruns" (datruns) "
|
---|
359 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile
|
---|
360 | # print to single logfile
|
---|
361 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
362 | echo "-----------------------" >> $logfile 2>&1
|
---|
363 | echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) "${qla[@]}" (qla) "$numdatruns" (datruns) " >> $logfile 2>&1
|
---|
364 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1
|
---|
365 | # print to global logfile
|
---|
366 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
367 | echo "-----------------------" >> $logfile2 2>&1
|
---|
368 | echo " number of files does not yet agree in all sites: "${newdaq[0]}" (newdaq) "${daq[0]}" (daq) "${zip[0]}" (data) "${dl00[0]}" (dl) "${wue[0]}" (wue) "${archive[0]}" (arch) "${fails[0]}" (fails) "${qla[@]}" (qla) "$numdatruns" (datruns) " >> $logfile2 2>&1
|
---|
369 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1
|
---|
370 | continue
|
---|
371 | fi
|
---|
372 |
|
---|
373 | # check du for raw files
|
---|
374 | # la palma
|
---|
375 | if ! [ ${newdaq[1]} -eq ${daq[1]} ]
|
---|
376 | then
|
---|
377 | printprocesslog "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date
|
---|
378 | echo "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date >> $logfile 2>&1
|
---|
379 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
380 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
381 | result2="1"
|
---|
382 | else
|
---|
383 | numok=`echo " $numok + 1 " | bc -l `
|
---|
384 | result2="0"
|
---|
385 | fi
|
---|
386 | # check du for zipped raw files
|
---|
387 | # dl00
|
---|
388 | if ! [ ${zip[1]} -eq ${dl00[1]} ] && [ $date2 -gt 20120307 ]
|
---|
389 | then
|
---|
390 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date
|
---|
391 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date >> $logfile 2>&1
|
---|
392 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
393 | then
|
---|
394 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
395 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
396 | result2=$result2"1"
|
---|
397 | else
|
---|
398 | numok=`echo " $numok + 1 " | bc -l `
|
---|
399 | result2=$result2"0"
|
---|
400 | fi
|
---|
401 | else
|
---|
402 | numok=`echo " $numok + 1 " | bc -l `
|
---|
403 | result2=$result2"0"
|
---|
404 | fi
|
---|
405 | # archive
|
---|
406 | if ! [ ${zip[1]} -eq ${archive[1]} ]
|
---|
407 | then
|
---|
408 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date
|
---|
409 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date >> $logfile 2>&1
|
---|
410 | if ! [ ${archive[1]} -eq -1 ]
|
---|
411 | then
|
---|
412 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
413 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
414 | result2=$result2"1"
|
---|
415 | else
|
---|
416 | numok=`echo " $numok + 1 " | bc -l `
|
---|
417 | result2=$result2"0"
|
---|
418 | fi
|
---|
419 | else
|
---|
420 | numok=`echo " $numok + 1 " | bc -l `
|
---|
421 | result2=$result2"0"
|
---|
422 | fi
|
---|
423 | # wue
|
---|
424 | if ! [ ${zip[1]} -eq ${wue[1]} ]
|
---|
425 | then
|
---|
426 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date
|
---|
427 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date >> $logfile 2>&1
|
---|
428 | if ! [ ${wue[1]} -eq -1 ]
|
---|
429 | then
|
---|
430 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
431 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
432 | result2=$result2"1"
|
---|
433 | else
|
---|
434 | numok=`echo " $numok + 1 " | bc -l `
|
---|
435 | result2=$result2"0"
|
---|
436 | fi
|
---|
437 | else
|
---|
438 | numok=`echo " $numok + 1 " | bc -l `
|
---|
439 | result2=$result2"0"
|
---|
440 | fi
|
---|
441 | ## phido
|
---|
442 | #if ! [ ${zip[1]} -eq ${phido[1]} ]
|
---|
443 | #then
|
---|
444 | # printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date
|
---|
445 | # echo "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date >> $logfile 2>&1
|
---|
446 | # if ! [ ${phido[1]} -eq -1 ]
|
---|
447 | # then
|
---|
448 | # numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
449 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
450 | # result2=$result2"1"
|
---|
451 | # else
|
---|
452 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
453 | # result2=$result2"0"
|
---|
454 | # fi
|
---|
455 | #else
|
---|
456 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
457 | # result2=$result2"0"
|
---|
458 | #fi
|
---|
459 | #result=$result"-"
|
---|
460 |
|
---|
461 | # check DB (only starting from 8.3.2012) (if-clause to be removed later)
|
---|
462 | if [ $date2 -gt 20120307 ]
|
---|
463 | then
|
---|
464 | # lp
|
---|
465 | if ! [ $numruns -eq ${newdaq[0]} ]
|
---|
466 | then
|
---|
467 | printprocesslog "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")"
|
---|
468 | echo "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
469 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
470 | result3="1"
|
---|
471 | else
|
---|
472 | numok=`echo " $numok + 1 " | bc -l `
|
---|
473 | result3="0"
|
---|
474 | fi
|
---|
475 | # dl00
|
---|
476 | if ! [ $numruns -eq $numrsynced ]
|
---|
477 | then
|
---|
478 | printprocesslog "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
479 | echo "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
480 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
481 | result3=$result3"1"
|
---|
482 | else
|
---|
483 | numok=`echo " $numok + 1 " | bc -l `
|
---|
484 | result3=$result3"0"
|
---|
485 | fi
|
---|
486 | # archive
|
---|
487 | if ! [ $numruns -eq $numisdc ]
|
---|
488 | then
|
---|
489 | printprocesslog "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")"
|
---|
490 | echo "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
491 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
492 | result3=$result3"1"
|
---|
493 | else
|
---|
494 | numok=`echo " $numok + 1 " | bc -l `
|
---|
495 | result3=$result3"0"
|
---|
496 | fi
|
---|
497 | # wue
|
---|
498 | if ! [ $numruns -eq $numwue ]
|
---|
499 | then
|
---|
500 | printprocesslog "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
501 | echo "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
502 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
503 | result3=$result3"1"
|
---|
504 | else
|
---|
505 | numok=`echo " $numok + 1 " | bc -l `
|
---|
506 | result3=$result3"0"
|
---|
507 | fi
|
---|
508 | ## phido
|
---|
509 | #if ! [ $numruns -eq $numphido ]
|
---|
510 | #then
|
---|
511 | # printprocesslog "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
512 | # echo "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
513 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
514 | # result3=$result3"1"
|
---|
515 | #else
|
---|
516 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
517 | # result3=$result3"0"
|
---|
518 | #fi
|
---|
519 | fi
|
---|
520 |
|
---|
521 | #numdiff=0 # add for debugging so that single file sizes are not checked
|
---|
522 | printprocesslog "numdiff: "$numdiff
|
---|
523 | printprocesslog "INFO numok: "$numok
|
---|
524 | printprocesslog "INFO numpb: "$numpb
|
---|
525 | echo "numdiff: "$numdiff >> $logfile 2>&1
|
---|
526 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
527 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
528 | #if [ $numdiff -gt 0 ]
|
---|
529 | if [ $numdiff -ge 0 ]
|
---|
530 | then
|
---|
531 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2
|
---|
532 | runs=( `sendquery` )
|
---|
533 | archivediffcounter=0
|
---|
534 | archiveokcounter=0
|
---|
535 | wuediffcounter=0
|
---|
536 | wueokcounter=0
|
---|
537 | #phidodiffcounter=0
|
---|
538 | #phidookcounter=0
|
---|
539 | dl00diffcounter=0
|
---|
540 | dl00okcounter=0
|
---|
541 | daqdiffcounter=0
|
---|
542 | daqokcounter=0
|
---|
543 | printprocesslog "INFO found "${#runs[@]}" rawfiles in DB."
|
---|
544 | echo "INFO found "${#runs[@]}" rawfiles in DB." >> $logfile 2>&1
|
---|
545 | for run in ${runs[@]}
|
---|
546 | do
|
---|
547 | rawfile=$date2"_"`printf %03d $run`".fits"
|
---|
548 | #rawfile2=$rawfile".gz"
|
---|
549 | rawfile2=$rawfile".*z"
|
---|
550 | printprocesslog "INFO checking "$rawfile
|
---|
551 |
|
---|
552 | # get file sizes for run
|
---|
553 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
554 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
555 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
556 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
557 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
558 | then
|
---|
559 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
560 | fi
|
---|
561 | if ! [ ${archive[1]} -eq -1 ]
|
---|
562 | then
|
---|
563 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
564 | fi
|
---|
565 | if ! [ ${fails[1]} -eq -1 ]
|
---|
566 | then
|
---|
567 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
568 | fi
|
---|
569 | if ! [ ${wue[1]} -eq -1 ]
|
---|
570 | then
|
---|
571 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
572 | fi
|
---|
573 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
574 | #then
|
---|
575 | # sizephido=( `ssh -i /home_nfs/isdc/fact_opr/.ssh/id_rsa.fact_opr.phido 129.217.160.201 "ls -l $phidorawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
576 | #fi
|
---|
577 |
|
---|
578 | # check file sizes for run
|
---|
579 | # lp
|
---|
580 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
581 | then
|
---|
582 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
583 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
584 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
585 | else
|
---|
586 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
587 | fi
|
---|
588 | # dl00
|
---|
589 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
590 | then
|
---|
591 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
592 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
593 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
594 | else
|
---|
595 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
596 | fi
|
---|
597 | # archive
|
---|
598 | #if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ] #not yet ingested files are treated wrongly
|
---|
599 | #if [ ${archive[1]} -ne -1 ] && [ "$sizezip" != "$sizearchive" -o "$sizezip" != "$sizefails" ]
|
---|
600 | if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ]
|
---|
601 | then
|
---|
602 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
603 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
604 | #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]}
|
---|
605 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
606 | else
|
---|
607 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
608 | fi
|
---|
609 | # wue
|
---|
610 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
611 | then
|
---|
612 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
613 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
614 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
615 | else
|
---|
616 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
617 | fi
|
---|
618 | ## phido
|
---|
619 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
620 | #then
|
---|
621 | # printprocesslog " "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
622 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
623 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
624 | #else
|
---|
625 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
626 | #fi
|
---|
627 | done
|
---|
628 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2" AND fHasDrsFile=1"
|
---|
629 | drsruns=( `sendquery` )
|
---|
630 | printprocesslog "INFO found "${#drsruns[@]}" drsfiles in DB."
|
---|
631 | echo "INFO found "${#drsruns[@]}" drsfiles in DB." >> $logfile 2>&1
|
---|
632 | for drsrun in ${drsruns[@]}
|
---|
633 | do
|
---|
634 | rawfile=$date2"_"`printf %03d $drsrun`".drs.fits"
|
---|
635 | #rawfile2=$rawfile".gz"
|
---|
636 | rawfile2=$rawfile".*z"
|
---|
637 | # get file sizes for run
|
---|
638 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
639 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
640 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
641 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
642 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
643 | then
|
---|
644 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
645 | fi
|
---|
646 | if ! [ ${archive[1]} -eq -1 ]
|
---|
647 | then
|
---|
648 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
649 | fi
|
---|
650 | if ! [ ${fails[1]} -eq -1 ]
|
---|
651 | then
|
---|
652 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
653 | fi
|
---|
654 | if ! [ ${wue[1]} -eq -1 ]
|
---|
655 | then
|
---|
656 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
657 | fi
|
---|
658 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
659 | #then
|
---|
660 | # sizephido=( `ssh -i /home_nfs/isdc/fact_opr/.ssh/id_rsa.fact_opr.phido 129.217.160.201 "ls -l $phidorawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
661 | #fi
|
---|
662 |
|
---|
663 | # check file sizes for run
|
---|
664 | # lp
|
---|
665 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
666 | then
|
---|
667 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
668 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
669 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
670 | else
|
---|
671 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
672 | fi
|
---|
673 | # dl00
|
---|
674 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
675 | then
|
---|
676 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
677 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
678 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
679 | else
|
---|
680 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
681 | fi
|
---|
682 | #if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 ]
|
---|
683 | if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ]
|
---|
684 | then
|
---|
685 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
686 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
687 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
688 | else
|
---|
689 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
690 | fi
|
---|
691 | # wue
|
---|
692 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
693 | then
|
---|
694 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
695 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
696 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
697 | else
|
---|
698 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
699 | fi
|
---|
700 | ## phido
|
---|
701 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
702 | #then
|
---|
703 | # printprocesslog "WARN "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
704 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
705 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
706 | #else
|
---|
707 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
708 | #fi
|
---|
709 | done
|
---|
710 |
|
---|
711 | #result=$result"-"
|
---|
712 | # raw files
|
---|
713 | if [ $daqokcounter -eq ${daq[0]} ]
|
---|
714 | then
|
---|
715 | numok=`echo " $numok + 1 " | bc -l `
|
---|
716 | result4="0"
|
---|
717 | else
|
---|
718 | result4="1"
|
---|
719 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
720 | fi
|
---|
721 | # zipped files
|
---|
722 | # dl00
|
---|
723 | if [ $dl00okcounter -eq ${dl00[0]} ]
|
---|
724 | then
|
---|
725 | result4=$result4"0"
|
---|
726 | numok=`echo " $numok + 1 " | bc -l `
|
---|
727 | else
|
---|
728 | result4=$result4"1"
|
---|
729 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
730 | fi
|
---|
731 | # archive
|
---|
732 | # daq had been used, because archive[0] doesn't include fails[0]
|
---|
733 | #if [ $archiveokcounter -eq ${newdaq[0]} ]
|
---|
734 | # archive[0] had been used, because newdaq[0] might be empty
|
---|
735 | # in case the data was taken on data
|
---|
736 | #if [ $archiveokcounter -eq ${archive[0]} ]
|
---|
737 | # compare with daq[0] as there should be always data on data
|
---|
738 | if [ $archiveokcounter -eq ${daq[0]} ]
|
---|
739 | then
|
---|
740 | result4=$result4"0"
|
---|
741 | numok=`echo " $numok + 1 " | bc -l `
|
---|
742 | else
|
---|
743 | result4=$result4"1"
|
---|
744 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
745 | fi
|
---|
746 | # wue
|
---|
747 | if [ $wueokcounter -eq ${wue[0]} ]
|
---|
748 | then
|
---|
749 | result4=$result4"0"
|
---|
750 | numok=`echo " $numok + 1 " | bc -l `
|
---|
751 | else
|
---|
752 | result4=$result4"1"
|
---|
753 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
754 | fi
|
---|
755 | ## phido
|
---|
756 | #if [ $phidookcounter -eq ${phido[0]} ]
|
---|
757 | #then
|
---|
758 | # result4=$result4"0"
|
---|
759 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
760 | #else
|
---|
761 | # result4=$result4"1"
|
---|
762 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
763 | #fi
|
---|
764 | printprocesslog "INFO "$daqokcounter" files are ok on daq (raw)."
|
---|
765 | printprocesslog "INFO "$dl00okcounter" files are ok on dl00."
|
---|
766 | printprocesslog "INFO "$wueokcounter" files are ok in Wue."
|
---|
767 | printprocesslog "INFO "$archiveokcounter" files are ok in the archive."
|
---|
768 | #printprocesslog "INFO "$phidookcounter" files are ok on Phido."
|
---|
769 | echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1
|
---|
770 | echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1
|
---|
771 | echo "INFO "$wueokcounter" files are ok in Wue." >> $logfile 2>&1
|
---|
772 | echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1
|
---|
773 | #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1
|
---|
774 | if [ $daqdiffcounter -gt 0 ]
|
---|
775 | then
|
---|
776 | printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
777 | echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
778 | else
|
---|
779 | printprocesslog "INFO "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
780 | echo "INFO "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
781 | fi
|
---|
782 | if [ $dl00diffcounter -gt 0 ]
|
---|
783 | then
|
---|
784 | printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
785 | echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
786 | else
|
---|
787 | printprocesslog "INFO "$dl00diffcounter" files have a different size on dl00."
|
---|
788 | echo "INFO "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
789 | fi
|
---|
790 | if [ $wuediffcounter -gt 0 ]
|
---|
791 | then
|
---|
792 | printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
|
---|
793 | echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
794 | else
|
---|
795 | printprocesslog "INFO "$wuediffcounter" files have a different size in Wue."
|
---|
796 | echo "INFO "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
797 | fi
|
---|
798 | if [ $archivediffcounter -gt 0 ]
|
---|
799 | then
|
---|
800 | printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
|
---|
801 | echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
802 | else
|
---|
803 | printprocesslog "INFO "$archivediffcounter" files have a different size in the archive."
|
---|
804 | echo "INFO "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
805 | fi
|
---|
806 | #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
|
---|
807 | #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1
|
---|
808 | fi
|
---|
809 |
|
---|
810 | # print summary:
|
---|
811 | printprocesslog "INFO day ok: "$numdaysok
|
---|
812 | printprocesslog "INFO numok: "$numok
|
---|
813 | printprocesslog "INFO numpb: "$numpb
|
---|
814 | printprocesslog "result:"
|
---|
815 | printprocesslog "(qla-#files-dudir-db-filesize)"
|
---|
816 | #printprocesslog " ldawp-ldawp-ldawp-ldawp"
|
---|
817 | printprocesslog " q-ldaw-ldaw-ldaw-ldaw"
|
---|
818 | printprocesslog " "$result1"-"$result2"-"$result3"-"$result4
|
---|
819 | echo "INFO day ok: "$numdaysok >> $logfile 2>&1
|
---|
820 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
821 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
822 | echo "result:" >> $logfile 2>&1
|
---|
823 | echo "(qla-#files-dudir-db-filesize)" >> $logfile 2>&1
|
---|
824 | #echo " ldawp-ldawp-ldawp-ldawp" >> $logfile 2>&1
|
---|
825 | echo " q-ldaw-ldaw-ldaw-ldaw" >> $logfile 2>&1
|
---|
826 | echo " "$result1"-"$result2"-"$result3"-"$result4 >> $logfile 2>&1
|
---|
827 | sumdatanew=`echo " ( ${daq[1]} + ${zip[1]} ) / 1024 / 1024 / 1024 " | bc -l | cut -d. -f1`
|
---|
828 | sumdata=`echo " $sumdata + $sumdatanew " | bc -l | cut -d. -f1`
|
---|
829 | printprocesslog "checked alread "$sumdata" GB. "$sumdatanew" "${daq[1]}" "${zip[1]}
|
---|
830 | if [ $numpb -lt 4 ]
|
---|
831 | then
|
---|
832 | numdaysok=`echo " $numdaysok + 1 " | bc -l `
|
---|
833 | fi
|
---|
834 |
|
---|
835 | echo "SUMMARY for "$date
|
---|
836 | echo "-----------------------"
|
---|
837 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
838 | echo "-----------------------" >> $logfile 2>&1
|
---|
839 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
840 | echo "-----------------------" >> $logfile2 2>&1
|
---|
841 | #echo "res1:"$result1
|
---|
842 | #echo "res3:"$result3
|
---|
843 | #echo "res4:"$result4
|
---|
844 | #echo "arch:"${archive[0]}
|
---|
845 | #echo "isdc:"$numisdc
|
---|
846 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0000" ] && [ "$result4" = "0000" ]
|
---|
847 | then
|
---|
848 | echo " EVERYTHING is ok. "$date" can be deleted. "
|
---|
849 | echo "" >> $logfile 2>&1
|
---|
850 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
851 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
852 | echo " Details in the logfile "$logfile
|
---|
853 | echo "" >> $logfile 2>&1
|
---|
854 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
855 | sendemail="yes"
|
---|
856 | else
|
---|
857 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0010" ] && [ "$result4" = "0000" ] && [ ${archive[0]} -eq $numisdc ]
|
---|
858 | then
|
---|
859 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. "
|
---|
860 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile 2>&1
|
---|
861 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile2 2>&1
|
---|
862 | echo " TRANSFER is ok. "$date" can be deleted. "
|
---|
863 | echo "" >> $logfile 2>&1
|
---|
864 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
865 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
866 | echo " Details in the logfile "$logfile
|
---|
867 | echo "" >> $logfile 2>&1
|
---|
868 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
869 | sendemail="yes"
|
---|
870 | else
|
---|
871 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile
|
---|
872 | echo "" >> $logfile 2>&1
|
---|
873 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1
|
---|
874 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1
|
---|
875 | echo " resetting jobs in the DB might be needed."
|
---|
876 | echo " resetting jobs in the DB might be needed." >> $logfile 2>&1
|
---|
877 | echo " resetting jobs in the DB might be needed." >> $logfile2 2>&1
|
---|
878 | fi
|
---|
879 | fi
|
---|
880 | if [ $daqdiffcounter -gt 0 ]
|
---|
881 | then
|
---|
882 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
883 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
884 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile2 2>&1
|
---|
885 | fi
|
---|
886 | if [ $dl00diffcounter -gt 0 ]
|
---|
887 | then
|
---|
888 | echo " WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
889 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
890 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile2 2>&1
|
---|
891 | fi
|
---|
892 | if [ $wuediffcounter -gt 0 ]
|
---|
893 | then
|
---|
894 | echo " WARN "$wuediffcounter" files have a different size in Wue."
|
---|
895 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
896 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile2 2>&1
|
---|
897 | fi
|
---|
898 | if [ $archivediffcounter -gt 0 ]
|
---|
899 | then
|
---|
900 | echo " WARN "$archivediffcounter" files have a different size in the archive."
|
---|
901 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
902 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile2 2>&1
|
---|
903 | fi
|
---|
904 | if ! [ $numdatruns -eq $qla ]
|
---|
905 | then
|
---|
906 | echo "WARN not all data runs are processed yet by the QLA. "
|
---|
907 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile 2>&1
|
---|
908 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile2 2>&1
|
---|
909 | fi
|
---|
910 | echo ""
|
---|
911 | echo "" >> $logfile 2>&1
|
---|
912 | echo "" >> $logfile2 2>&1
|
---|
913 | done
|
---|
914 |
|
---|
915 | #sendemail="yes"
|
---|
916 | if [ "$sendemail" = "yes" ]
|
---|
917 | then
|
---|
918 | echo ""
|
---|
919 | echo "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
920 | printprocesslog "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
921 | cat $logfile2 | mail -s "testmail for info on deleting data" shift@fact-project.org
|
---|
922 | fi
|
---|
923 |
|
---|
924 | printprocesslog "INFO finished $0"
|
---|
925 |
|
---|