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 2>&1
|
---|
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 | # on newdaq files with more than 3 digits as run number are excluded
|
---|
155 | newdaq=( `ssh fact@161.72.93.131 "if [ -d $lprawpath ]; then ls $lprawpath/${date2}_[0-9][0-9][0-9][.]* | wc -l; du -s -b --apparent-size $lprawpath; else echo '-1 -1 -1'; fi"` )
|
---|
156 | 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"` )
|
---|
157 | if [ ${newdaq[0]} -eq -1 ] && [ ${daq[0]} -eq -1 ]
|
---|
158 | then
|
---|
159 | printprocesslog "INFO no data available on newdaq for "$date
|
---|
160 | echo "INFO no data available on newdaq for "$date >> $logfile 2>&1
|
---|
161 | continue
|
---|
162 | fi
|
---|
163 | 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"` )
|
---|
164 | dl00=( `if [ -d $localrawpath ]; then ls $localrawpath/* | wc -l; du -s -b --apparent-size $localrawpath; else echo '-1 -1 -1'; fi` )
|
---|
165 | 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` )
|
---|
166 | fails=( `if [ -d $localfailpath ]; then ls $localfailpath/* | wc -l; du -L -s -b --apparent-size $localfailpath; else echo '-1 -1 -1'; fi` )
|
---|
167 | 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"` )
|
---|
168 | #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"` )
|
---|
169 | qla=( `ssh fact@161.72.93.131 "ls $qlapath/20*_C.root 2>/dev/null | wc -l"` )
|
---|
170 | query="SELECT Sum(if(fHasDrsFile=1,2,1)) FROM RunInfo WHERE fNight="$date2
|
---|
171 | querystart="SELECT Sum(if(fHasDrsFile=1,2,1)) FROM "
|
---|
172 | queryjoin="LEFT JOIN RunInfo USING(fNight,fRunID) "
|
---|
173 | querywhere="WHERE fNight="$date2" AND NOT ISNULL(fStartTime) AND NOT ISNULL(fStopTime) AND ISNULL(fReturnCode)"
|
---|
174 | numruns=`sendquery`
|
---|
175 | if [ "$numruns" == "" ]
|
---|
176 | then
|
---|
177 | numruns=0
|
---|
178 | fi
|
---|
179 | query=$querystart"RawFileRsyncedISDCStatus "$queryjoin" "$querywhere
|
---|
180 | numrsynced=`sendquery`
|
---|
181 | if [ "$numrsynced" == "" ]
|
---|
182 | then
|
---|
183 | numrsynced=0
|
---|
184 | fi
|
---|
185 | query=$querystart"RawFileAvailISDCStatus "$queryjoin" "$querywhere
|
---|
186 | numisdc=`sendquery`
|
---|
187 | if [ "$numisdc" == "" ]
|
---|
188 | then
|
---|
189 | numisdc=0
|
---|
190 | fi
|
---|
191 | query=$querystart"RawFileAvailWueStatus "$queryjoin" "$querywhere
|
---|
192 | numwue=`sendquery`
|
---|
193 | if [ "$numwue" == "" ]
|
---|
194 | then
|
---|
195 | numwue=0
|
---|
196 | fi
|
---|
197 | #query=$querystart"RawFileAvailPhidoStatus "$queryjoin" "$querywhere
|
---|
198 | #numphido=`sendquery`
|
---|
199 | #if [ "$numphido" == "" ]
|
---|
200 | #then
|
---|
201 | # numphido=0
|
---|
202 | #fi
|
---|
203 |
|
---|
204 | # select number of data runs
|
---|
205 | query="SELECT COUNT(*) FROM RunInfo WHERE fNight="$date2
|
---|
206 | query=$query" AND fRunTypeKey=1"
|
---|
207 | numdatruns=`sendquery`
|
---|
208 |
|
---|
209 | printprocesslog "disk: "
|
---|
210 | printprocesslog " newdaq "${newdaq[@]}
|
---|
211 | printprocesslog " daq "${daq[@]}
|
---|
212 | printprocesslog " data "${zip[@]}
|
---|
213 | printprocesslog " dl00 "${dl00[@]}
|
---|
214 | printprocesslog " wue "${wue[@]}
|
---|
215 | printprocesslog " arch "${archive[@]}
|
---|
216 | printprocesslog " fail "${fails[@]}
|
---|
217 | #printprocesslog " phido "${phido[@]}
|
---|
218 | printprocesslog " qla "${qla[@]}
|
---|
219 | printprocesslog "db: "
|
---|
220 | printprocesslog " runinfo "$numruns
|
---|
221 | printprocesslog " rsynced "$numrsynced
|
---|
222 | printprocesslog " isdc "$numisdc
|
---|
223 | printprocesslog " wue "$numwue
|
---|
224 | #printprocesslog " phido "$numphido
|
---|
225 | printprocesslog " data "$numdatruns
|
---|
226 | echo "disk: " >> $logfile 2>&1
|
---|
227 | echo " newdaq "${newdaq[@]} >> $logfile 2>&1
|
---|
228 | echo " daq "${daq[@]} >> $logfile 2>&1
|
---|
229 | echo " data "${zip[@]} >> $logfile 2>&1
|
---|
230 | echo " dl00 "${dl00[@]} >> $logfile 2>&1
|
---|
231 | echo " wue "${wue[@]} >> $logfile 2>&1
|
---|
232 | echo " arch "${archive[@]} >> $logfile 2>&1
|
---|
233 | echo " fail "${fails[@]} >> $logfile 2>&1
|
---|
234 | #echo " phido "${phido[@]} >> $logfile 2>&1
|
---|
235 | echo " qla "${qla[@]} >> $logfile 2>&1
|
---|
236 | echo "db: " >> $logfile 2>&1
|
---|
237 | echo " runinfo "$numruns >> $logfile 2>&1
|
---|
238 | echo " rsynced "$numrsynced >> $logfile 2>&1
|
---|
239 | echo " isdc "$numisdc >> $logfile 2>&1
|
---|
240 | echo " wue "$numwue >> $logfile 2>&1
|
---|
241 | #echo " phido "$numphido >> $logfile 2>&1
|
---|
242 | echo " datruns "$numdatruns >> $logfile 2>&1
|
---|
243 |
|
---|
244 | if ! [ $numdatruns -eq $qla ]
|
---|
245 | then
|
---|
246 | printprocesslog "WARN not all data runs are processed yet by the QLA for "$date"."
|
---|
247 | echo "WARN not all data runs are processed yet by the QLA for "$date >> $logfile 2>&1
|
---|
248 | result1="1-"
|
---|
249 | else
|
---|
250 | result1="0-"
|
---|
251 | fi
|
---|
252 | # check if file are available in the different places
|
---|
253 | if [ ${dl00[0]} -eq -1 ] && [ $date2 -lt 20120308 ]
|
---|
254 | then
|
---|
255 | printprocesslog "INFO data not available on /scratch on dl00 for "$date
|
---|
256 | echo "INFO data not available on /scratch on dl00 for "$date >> $logfile 2>&1
|
---|
257 | fi
|
---|
258 | if [ ${archive[0]} -eq -1 ]
|
---|
259 | then
|
---|
260 | printprocesslog "INFO data not in archive for "$date
|
---|
261 | echo "INFO data not in archive for "$date >> $logfile 2>&1
|
---|
262 | fi
|
---|
263 |
|
---|
264 | # check if number of files agree in the different places
|
---|
265 | # lp
|
---|
266 | if ! [ ${daq[0]} -eq -1 ] && ! [ ${daq[0]} -eq ${newdaq[0]} ]
|
---|
267 | then
|
---|
268 | printprocesslog "WARN number of files on daq (" ${daq[0]}") does not agree with number of files on newdaq (" ${newdaq[0]}") for "$date
|
---|
269 | 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
|
---|
270 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
271 | result1=$result1"1"
|
---|
272 | else
|
---|
273 | numok=`echo " $numok + 1 " | bc -l `
|
---|
274 | result1=$result1"0"
|
---|
275 | fi
|
---|
276 | # dl00
|
---|
277 | #if ! [ ${dl00[0]} -eq -1 ] && ! [ ${dl00[0]} -eq ${newdaq[0]} ]
|
---|
278 | if ! [ ${dl00[0]} -eq ${newdaq[0]} ]
|
---|
279 | then
|
---|
280 | printprocesslog "WARN number of files on dl00 (" ${dl00[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
281 | 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
|
---|
282 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
283 | result1=$result1"1"
|
---|
284 | else
|
---|
285 | numok=`echo " $numok + 1 " | bc -l `
|
---|
286 | result1=$result1"0"
|
---|
287 | fi
|
---|
288 | # archive
|
---|
289 | if ! [ ${archive[0]} -eq -1 ] && ! [ ${archive[0]} -eq ${newdaq[0]} ]
|
---|
290 | then
|
---|
291 | printprocesslog "WARN number of files in archive (" ${archive[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
292 | 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
|
---|
293 | #check /archive/rev_1/failed
|
---|
294 | if ! [ ${fails[0]} -eq -1 ]
|
---|
295 | then
|
---|
296 | sum=`echo " ${fails[0]} + ${archive[0]} " | bc -l `
|
---|
297 | if ! [ $sum -eq ${newdaq[0]} ]
|
---|
298 | then
|
---|
299 | printprocesslog "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")."
|
---|
300 | echo "ERROR number of files in whole archive ("$sum") is different from number of files in La Palma ("${newdaq[0]}")." >> $logfile 2>&1
|
---|
301 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
302 | result1=$result1"1"
|
---|
303 | else
|
---|
304 | numok=`echo " $numok + 1 " | bc -l `
|
---|
305 | result1=$result1"0"
|
---|
306 | fi
|
---|
307 | else
|
---|
308 | result1=$result1"1"
|
---|
309 | fi
|
---|
310 | else
|
---|
311 | if [ ${archive[0]} -eq -1 ]
|
---|
312 | then
|
---|
313 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
314 | result1=$result1"1"
|
---|
315 | else
|
---|
316 | numok=`echo " $numok + 1 " | bc -l `
|
---|
317 | result1=$result1"0"
|
---|
318 | fi
|
---|
319 | fi
|
---|
320 | # wue
|
---|
321 | #if ! [ ${wue[0]} -eq -1 ] && ! [ ${wue[0]} -eq ${newdaq[0]} ]
|
---|
322 | if ! [ ${wue[0]} -eq ${newdaq[0]} ]
|
---|
323 | then
|
---|
324 | printprocesslog "WARN number of files in Wue (" ${wue[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
325 | 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
|
---|
326 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
327 | result1=$result1"1"
|
---|
328 | else
|
---|
329 | numok=`echo " $numok + 1 " | bc -l `
|
---|
330 | result1=$result1"0"
|
---|
331 | fi
|
---|
332 | ## phido
|
---|
333 | #if ! [ ${phido[0]} -eq -1 ] && ! [ ${phido[0]} -eq ${newdaq[0]} ]
|
---|
334 | #then
|
---|
335 | # printprocesslog "WARN number of files on Phido (" ${phido[0]}") does not agree with number of files in LP (" ${newdaq[0]}") for "$date
|
---|
336 | # 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
|
---|
337 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
338 | # result1=$result1"1"
|
---|
339 | #else
|
---|
340 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
341 | # result1=$result1"0"
|
---|
342 | #fi
|
---|
343 |
|
---|
344 | short2=
|
---|
345 | if [ "$result1" != "0-0000" ] && [ "$short" != "no" ]
|
---|
346 | then
|
---|
347 | short2="yes"
|
---|
348 | fi
|
---|
349 |
|
---|
350 | if [ "$short2" = "yes" ]
|
---|
351 | then
|
---|
352 | printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking."
|
---|
353 | echo "" >> $logfile 2>&1
|
---|
354 | echo "number of files does not yet agree in all sites ("$result1") -> do no further checking." >> $logfile 2>&1
|
---|
355 | echo "" >> $logfile 2>&1
|
---|
356 | # print to console
|
---|
357 | echo "SUMMARY for "$date
|
---|
358 | echo "-----------------------"
|
---|
359 | 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) "
|
---|
360 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile
|
---|
361 | # print to single logfile
|
---|
362 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
363 | echo "-----------------------" >> $logfile 2>&1
|
---|
364 | 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
|
---|
365 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1
|
---|
366 | # print to global logfile
|
---|
367 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
368 | echo "-----------------------" >> $logfile2 2>&1
|
---|
369 | 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
|
---|
370 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1
|
---|
371 | continue
|
---|
372 | fi
|
---|
373 |
|
---|
374 | # check du for raw files
|
---|
375 | # la palma
|
---|
376 | if ! [ ${newdaq[1]} -eq ${daq[1]} ]
|
---|
377 | then
|
---|
378 | printprocesslog "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date
|
---|
379 | echo "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date >> $logfile 2>&1
|
---|
380 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
381 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
382 | result2="1"
|
---|
383 | else
|
---|
384 | numok=`echo " $numok + 1 " | bc -l `
|
---|
385 | result2="0"
|
---|
386 | fi
|
---|
387 | # check du for zipped raw files
|
---|
388 | # dl00
|
---|
389 | if ! [ ${zip[1]} -eq ${dl00[1]} ] && [ $date2 -gt 20120307 ]
|
---|
390 | then
|
---|
391 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date
|
---|
392 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date >> $logfile 2>&1
|
---|
393 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
394 | then
|
---|
395 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
396 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
397 | result2=$result2"1"
|
---|
398 | else
|
---|
399 | numok=`echo " $numok + 1 " | bc -l `
|
---|
400 | result2=$result2"0"
|
---|
401 | fi
|
---|
402 | else
|
---|
403 | numok=`echo " $numok + 1 " | bc -l `
|
---|
404 | result2=$result2"0"
|
---|
405 | fi
|
---|
406 | # archive
|
---|
407 | if ! [ ${zip[1]} -eq ${archive[1]} ]
|
---|
408 | then
|
---|
409 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date
|
---|
410 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date >> $logfile 2>&1
|
---|
411 | if ! [ ${archive[1]} -eq -1 ]
|
---|
412 | then
|
---|
413 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
414 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
415 | result2=$result2"1"
|
---|
416 | else
|
---|
417 | numok=`echo " $numok + 1 " | bc -l `
|
---|
418 | result2=$result2"0"
|
---|
419 | fi
|
---|
420 | else
|
---|
421 | numok=`echo " $numok + 1 " | bc -l `
|
---|
422 | result2=$result2"0"
|
---|
423 | fi
|
---|
424 | # wue
|
---|
425 | if ! [ ${zip[1]} -eq ${wue[1]} ]
|
---|
426 | then
|
---|
427 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date
|
---|
428 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date >> $logfile 2>&1
|
---|
429 | if ! [ ${wue[1]} -eq -1 ]
|
---|
430 | then
|
---|
431 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
432 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
433 | result2=$result2"1"
|
---|
434 | else
|
---|
435 | numok=`echo " $numok + 1 " | bc -l `
|
---|
436 | result2=$result2"0"
|
---|
437 | fi
|
---|
438 | else
|
---|
439 | numok=`echo " $numok + 1 " | bc -l `
|
---|
440 | result2=$result2"0"
|
---|
441 | fi
|
---|
442 | ## phido
|
---|
443 | #if ! [ ${zip[1]} -eq ${phido[1]} ]
|
---|
444 | #then
|
---|
445 | # printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date
|
---|
446 | # echo "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date >> $logfile 2>&1
|
---|
447 | # if ! [ ${phido[1]} -eq -1 ]
|
---|
448 | # then
|
---|
449 | # numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
450 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
451 | # result2=$result2"1"
|
---|
452 | # else
|
---|
453 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
454 | # result2=$result2"0"
|
---|
455 | # fi
|
---|
456 | #else
|
---|
457 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
458 | # result2=$result2"0"
|
---|
459 | #fi
|
---|
460 | #result=$result"-"
|
---|
461 |
|
---|
462 | # check DB (only starting from 8.3.2012) (if-clause to be removed later)
|
---|
463 | if [ $date2 -gt 20120307 ]
|
---|
464 | then
|
---|
465 | # lp
|
---|
466 | if ! [ $numruns -eq ${newdaq[0]} ]
|
---|
467 | then
|
---|
468 | printprocesslog "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")"
|
---|
469 | echo "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
470 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
471 | result3="1"
|
---|
472 | else
|
---|
473 | numok=`echo " $numok + 1 " | bc -l `
|
---|
474 | result3="0"
|
---|
475 | fi
|
---|
476 | # dl00
|
---|
477 | if ! [ $numruns -eq $numrsynced ]
|
---|
478 | then
|
---|
479 | printprocesslog "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
480 | echo "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
481 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
482 | result3=$result3"1"
|
---|
483 | else
|
---|
484 | numok=`echo " $numok + 1 " | bc -l `
|
---|
485 | result3=$result3"0"
|
---|
486 | fi
|
---|
487 | # archive
|
---|
488 | if ! [ $numruns -eq $numisdc ]
|
---|
489 | then
|
---|
490 | printprocesslog "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")"
|
---|
491 | echo "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
492 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
493 | result3=$result3"1"
|
---|
494 | else
|
---|
495 | numok=`echo " $numok + 1 " | bc -l `
|
---|
496 | result3=$result3"0"
|
---|
497 | fi
|
---|
498 | # wue
|
---|
499 | if ! [ $numruns -eq $numwue ]
|
---|
500 | then
|
---|
501 | printprocesslog "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
502 | echo "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
503 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
504 | result3=$result3"1"
|
---|
505 | else
|
---|
506 | numok=`echo " $numok + 1 " | bc -l `
|
---|
507 | result3=$result3"0"
|
---|
508 | fi
|
---|
509 | ## phido
|
---|
510 | #if ! [ $numruns -eq $numphido ]
|
---|
511 | #then
|
---|
512 | # printprocesslog "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
513 | # echo "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
514 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
515 | # result3=$result3"1"
|
---|
516 | #else
|
---|
517 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
518 | # result3=$result3"0"
|
---|
519 | #fi
|
---|
520 | fi
|
---|
521 |
|
---|
522 | #numdiff=0 # add for debugging so that single file sizes are not checked
|
---|
523 | printprocesslog "numdiff: "$numdiff
|
---|
524 | printprocesslog "INFO numok: "$numok
|
---|
525 | printprocesslog "INFO numpb: "$numpb
|
---|
526 | echo "numdiff: "$numdiff >> $logfile 2>&1
|
---|
527 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
528 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
529 | #if [ $numdiff -gt 0 ]
|
---|
530 | if [ $numdiff -ge 0 ]
|
---|
531 | then
|
---|
532 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2
|
---|
533 | runs=( `sendquery` )
|
---|
534 | archivediffcounter=0
|
---|
535 | archiveokcounter=0
|
---|
536 | wuediffcounter=0
|
---|
537 | wueokcounter=0
|
---|
538 | #phidodiffcounter=0
|
---|
539 | #phidookcounter=0
|
---|
540 | dl00diffcounter=0
|
---|
541 | dl00okcounter=0
|
---|
542 | daqdiffcounter=0
|
---|
543 | daqokcounter=0
|
---|
544 | printprocesslog "INFO found "${#runs[@]}" rawfiles in DB."
|
---|
545 | echo "INFO found "${#runs[@]}" rawfiles in DB." >> $logfile 2>&1
|
---|
546 | for run in ${runs[@]}
|
---|
547 | do
|
---|
548 | rawfile=$date2"_"`printf %03d $run`".fits"
|
---|
549 | #rawfile2=$rawfile".gz"
|
---|
550 | rawfile2=$rawfile".*z"
|
---|
551 | printprocesslog "INFO checking "$rawfile
|
---|
552 |
|
---|
553 | # get file sizes for run
|
---|
554 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
555 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
556 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
557 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
558 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
559 | then
|
---|
560 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
561 | fi
|
---|
562 | if ! [ ${archive[1]} -eq -1 ]
|
---|
563 | then
|
---|
564 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
565 | fi
|
---|
566 | if ! [ ${fails[1]} -eq -1 ]
|
---|
567 | then
|
---|
568 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
569 | fi
|
---|
570 | if ! [ ${wue[1]} -eq -1 ]
|
---|
571 | then
|
---|
572 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
573 | fi
|
---|
574 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
575 | #then
|
---|
576 | # 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 }'"` )
|
---|
577 | #fi
|
---|
578 |
|
---|
579 | # check file sizes for run
|
---|
580 | # lp
|
---|
581 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
582 | then
|
---|
583 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
584 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
585 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
586 | else
|
---|
587 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
588 | fi
|
---|
589 | # dl00
|
---|
590 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
591 | then
|
---|
592 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
593 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
594 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
595 | else
|
---|
596 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
597 | fi
|
---|
598 | # archive
|
---|
599 | #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
|
---|
600 | #if [ ${archive[1]} -ne -1 ] && [ "$sizezip" != "$sizearchive" -o "$sizezip" != "$sizefails" ]
|
---|
601 | if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ]
|
---|
602 | then
|
---|
603 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
604 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
605 | #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]}
|
---|
606 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
607 | else
|
---|
608 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
609 | fi
|
---|
610 | # wue
|
---|
611 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
612 | then
|
---|
613 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
614 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
615 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
616 | else
|
---|
617 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
618 | fi
|
---|
619 | ## phido
|
---|
620 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
621 | #then
|
---|
622 | # printprocesslog " "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
623 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
624 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
625 | #else
|
---|
626 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
627 | #fi
|
---|
628 | done
|
---|
629 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2" AND fHasDrsFile=1"
|
---|
630 | drsruns=( `sendquery` )
|
---|
631 | printprocesslog "INFO found "${#drsruns[@]}" drsfiles in DB."
|
---|
632 | echo "INFO found "${#drsruns[@]}" drsfiles in DB." >> $logfile 2>&1
|
---|
633 | for drsrun in ${drsruns[@]}
|
---|
634 | do
|
---|
635 | rawfile=$date2"_"`printf %03d $drsrun`".drs.fits"
|
---|
636 | #rawfile2=$rawfile".gz"
|
---|
637 | rawfile2=$rawfile".*z"
|
---|
638 | # get file sizes for run
|
---|
639 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
640 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
641 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
642 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
643 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
644 | then
|
---|
645 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
646 | fi
|
---|
647 | if ! [ ${archive[1]} -eq -1 ]
|
---|
648 | then
|
---|
649 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
650 | fi
|
---|
651 | if ! [ ${fails[1]} -eq -1 ]
|
---|
652 | then
|
---|
653 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
654 | fi
|
---|
655 | if ! [ ${wue[1]} -eq -1 ]
|
---|
656 | then
|
---|
657 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
658 | fi
|
---|
659 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
660 | #then
|
---|
661 | # 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 }'"` )
|
---|
662 | #fi
|
---|
663 |
|
---|
664 | # check file sizes for run
|
---|
665 | # lp
|
---|
666 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
667 | then
|
---|
668 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
669 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
670 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
671 | else
|
---|
672 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
673 | fi
|
---|
674 | # dl00
|
---|
675 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
676 | then
|
---|
677 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
678 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
679 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
680 | else
|
---|
681 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
682 | fi
|
---|
683 | #if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 ]
|
---|
684 | if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ]
|
---|
685 | then
|
---|
686 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
687 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
688 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
689 | else
|
---|
690 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
691 | fi
|
---|
692 | # wue
|
---|
693 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
694 | then
|
---|
695 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
696 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
697 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
698 | else
|
---|
699 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
700 | fi
|
---|
701 | ## phido
|
---|
702 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
703 | #then
|
---|
704 | # printprocesslog "WARN "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
705 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
706 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
707 | #else
|
---|
708 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
709 | #fi
|
---|
710 | done
|
---|
711 |
|
---|
712 | #result=$result"-"
|
---|
713 | # raw files
|
---|
714 | if [ $daqokcounter -eq ${daq[0]} ]
|
---|
715 | then
|
---|
716 | numok=`echo " $numok + 1 " | bc -l `
|
---|
717 | result4="0"
|
---|
718 | else
|
---|
719 | result4="1"
|
---|
720 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
721 | fi
|
---|
722 | # zipped files
|
---|
723 | # dl00
|
---|
724 | if [ $dl00okcounter -eq ${dl00[0]} ]
|
---|
725 | then
|
---|
726 | result4=$result4"0"
|
---|
727 | numok=`echo " $numok + 1 " | bc -l `
|
---|
728 | else
|
---|
729 | result4=$result4"1"
|
---|
730 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
731 | fi
|
---|
732 | # archive
|
---|
733 | # daq had been used, because archive[0] doesn't include fails[0]
|
---|
734 | #if [ $archiveokcounter -eq ${newdaq[0]} ]
|
---|
735 | # archive[0] had been used, because newdaq[0] might be empty
|
---|
736 | # in case the data was taken on data
|
---|
737 | #if [ $archiveokcounter -eq ${archive[0]} ]
|
---|
738 | # compare with daq[0] as there should be always data on data
|
---|
739 | if [ $archiveokcounter -eq ${daq[0]} ]
|
---|
740 | then
|
---|
741 | result4=$result4"0"
|
---|
742 | numok=`echo " $numok + 1 " | bc -l `
|
---|
743 | else
|
---|
744 | result4=$result4"1"
|
---|
745 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
746 | fi
|
---|
747 | # wue
|
---|
748 | if [ $wueokcounter -eq ${wue[0]} ]
|
---|
749 | then
|
---|
750 | result4=$result4"0"
|
---|
751 | numok=`echo " $numok + 1 " | bc -l `
|
---|
752 | else
|
---|
753 | result4=$result4"1"
|
---|
754 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
755 | fi
|
---|
756 | ## phido
|
---|
757 | #if [ $phidookcounter -eq ${phido[0]} ]
|
---|
758 | #then
|
---|
759 | # result4=$result4"0"
|
---|
760 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
761 | #else
|
---|
762 | # result4=$result4"1"
|
---|
763 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
764 | #fi
|
---|
765 | printprocesslog "INFO "$daqokcounter" files are ok on daq (raw)."
|
---|
766 | printprocesslog "INFO "$dl00okcounter" files are ok on dl00."
|
---|
767 | printprocesslog "INFO "$wueokcounter" files are ok in Wue."
|
---|
768 | printprocesslog "INFO "$archiveokcounter" files are ok in the archive."
|
---|
769 | #printprocesslog "INFO "$phidookcounter" files are ok on Phido."
|
---|
770 | echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1
|
---|
771 | echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1
|
---|
772 | echo "INFO "$wueokcounter" files are ok in Wue." >> $logfile 2>&1
|
---|
773 | echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1
|
---|
774 | #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1
|
---|
775 | if [ $daqdiffcounter -gt 0 ]
|
---|
776 | then
|
---|
777 | printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
778 | echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
779 | else
|
---|
780 | printprocesslog "INFO "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
781 | echo "INFO "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
782 | fi
|
---|
783 | if [ $dl00diffcounter -gt 0 ]
|
---|
784 | then
|
---|
785 | printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
786 | echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
787 | else
|
---|
788 | printprocesslog "INFO "$dl00diffcounter" files have a different size on dl00."
|
---|
789 | echo "INFO "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
790 | fi
|
---|
791 | if [ $wuediffcounter -gt 0 ]
|
---|
792 | then
|
---|
793 | printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
|
---|
794 | echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
795 | else
|
---|
796 | printprocesslog "INFO "$wuediffcounter" files have a different size in Wue."
|
---|
797 | echo "INFO "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
798 | fi
|
---|
799 | if [ $archivediffcounter -gt 0 ]
|
---|
800 | then
|
---|
801 | printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
|
---|
802 | echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
803 | else
|
---|
804 | printprocesslog "INFO "$archivediffcounter" files have a different size in the archive."
|
---|
805 | echo "INFO "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
806 | fi
|
---|
807 | #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
|
---|
808 | #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1
|
---|
809 | fi
|
---|
810 |
|
---|
811 | # print summary:
|
---|
812 | printprocesslog "INFO day ok: "$numdaysok
|
---|
813 | printprocesslog "INFO numok: "$numok
|
---|
814 | printprocesslog "INFO numpb: "$numpb
|
---|
815 | printprocesslog "result:"
|
---|
816 | printprocesslog "(qla-#files-dudir-db-filesize)"
|
---|
817 | #printprocesslog " ldawp-ldawp-ldawp-ldawp"
|
---|
818 | printprocesslog " q-ldaw-ldaw-ldaw-ldaw"
|
---|
819 | printprocesslog " "$result1"-"$result2"-"$result3"-"$result4
|
---|
820 | echo "INFO day ok: "$numdaysok >> $logfile 2>&1
|
---|
821 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
822 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
823 | echo "result:" >> $logfile 2>&1
|
---|
824 | echo "(qla-#files-dudir-db-filesize)" >> $logfile 2>&1
|
---|
825 | #echo " ldawp-ldawp-ldawp-ldawp" >> $logfile 2>&1
|
---|
826 | echo " q-ldaw-ldaw-ldaw-ldaw" >> $logfile 2>&1
|
---|
827 | echo " "$result1"-"$result2"-"$result3"-"$result4 >> $logfile 2>&1
|
---|
828 | sumdatanew=`echo " ( ${daq[1]} + ${zip[1]} ) / 1024 / 1024 / 1024 " | bc -l | cut -d. -f1`
|
---|
829 | sumdata=`echo " $sumdata + $sumdatanew " | bc -l | cut -d. -f1`
|
---|
830 | printprocesslog "checked alread "$sumdata" GB. "$sumdatanew" "${daq[1]}" "${zip[1]}
|
---|
831 | if [ $numpb -lt 4 ]
|
---|
832 | then
|
---|
833 | numdaysok=`echo " $numdaysok + 1 " | bc -l `
|
---|
834 | fi
|
---|
835 |
|
---|
836 | echo "SUMMARY for "$date
|
---|
837 | echo "-----------------------"
|
---|
838 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
839 | echo "-----------------------" >> $logfile 2>&1
|
---|
840 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
841 | echo "-----------------------" >> $logfile2 2>&1
|
---|
842 | #echo "res1:"$result1
|
---|
843 | #echo "res3:"$result3
|
---|
844 | #echo "res4:"$result4
|
---|
845 | #echo "arch:"${archive[0]}
|
---|
846 | #echo "isdc:"$numisdc
|
---|
847 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0000" ] && [ "$result4" = "0000" ]
|
---|
848 | then
|
---|
849 | echo " EVERYTHING is ok. "$date" can be deleted. "
|
---|
850 | echo "" >> $logfile 2>&1
|
---|
851 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
852 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
853 | echo " Details in the logfile "$logfile
|
---|
854 | echo "" >> $logfile 2>&1
|
---|
855 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
856 | sendemail="yes"
|
---|
857 | else
|
---|
858 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0010" ] && [ "$result4" = "0000" ] && [ ${archive[0]} -eq $numisdc ]
|
---|
859 | then
|
---|
860 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. "
|
---|
861 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile 2>&1
|
---|
862 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile2 2>&1
|
---|
863 | echo " TRANSFER is ok. "$date" can be deleted. "
|
---|
864 | echo "" >> $logfile 2>&1
|
---|
865 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
866 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
867 | echo " Details in the logfile "$logfile
|
---|
868 | echo "" >> $logfile 2>&1
|
---|
869 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
870 | sendemail="yes"
|
---|
871 | else
|
---|
872 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile
|
---|
873 | echo "" >> $logfile 2>&1
|
---|
874 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1
|
---|
875 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1
|
---|
876 | echo " resetting jobs in the DB might be needed."
|
---|
877 | echo " resetting jobs in the DB might be needed." >> $logfile 2>&1
|
---|
878 | echo " resetting jobs in the DB might be needed." >> $logfile2 2>&1
|
---|
879 | fi
|
---|
880 | fi
|
---|
881 | if [ $daqdiffcounter -gt 0 ]
|
---|
882 | then
|
---|
883 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
884 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
885 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile2 2>&1
|
---|
886 | fi
|
---|
887 | if [ $dl00diffcounter -gt 0 ]
|
---|
888 | then
|
---|
889 | echo " WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
890 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
891 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile2 2>&1
|
---|
892 | fi
|
---|
893 | if [ $wuediffcounter -gt 0 ]
|
---|
894 | then
|
---|
895 | echo " WARN "$wuediffcounter" files have a different size in Wue."
|
---|
896 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
897 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile2 2>&1
|
---|
898 | fi
|
---|
899 | if [ $archivediffcounter -gt 0 ]
|
---|
900 | then
|
---|
901 | echo " WARN "$archivediffcounter" files have a different size in the archive."
|
---|
902 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
903 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile2 2>&1
|
---|
904 | fi
|
---|
905 | if ! [ $numdatruns -eq $qla ]
|
---|
906 | then
|
---|
907 | echo "WARN not all data runs are processed yet by the QLA. "
|
---|
908 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile 2>&1
|
---|
909 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile2 2>&1
|
---|
910 | fi
|
---|
911 | echo ""
|
---|
912 | echo "" >> $logfile 2>&1
|
---|
913 | echo "" >> $logfile2 2>&1
|
---|
914 | done
|
---|
915 |
|
---|
916 | #sendemail="yes"
|
---|
917 | if [ "$sendemail" = "yes" ]
|
---|
918 | then
|
---|
919 | echo ""
|
---|
920 | echo "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
921 | printprocesslog "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
922 | cat $logfile2 | mail -s "testmail for info on deleting data" shift@fact-project.org
|
---|
923 | fi
|
---|
924 |
|
---|
925 | printprocesslog "INFO finished $0"
|
---|
926 |
|
---|