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 | if grep "EVERYTHING" $logfile >/dev/null
|
---|
95 | then
|
---|
96 | echo $date" has been checked already and is fine."
|
---|
97 | echo $date" has been checked already and is fine." >> $logfile2 2>&1
|
---|
98 | continue
|
---|
99 | fi
|
---|
100 | #echo ""
|
---|
101 | #echo ""
|
---|
102 | #echo ""
|
---|
103 | #echo "" > $logfile 2>&1
|
---|
104 | #echo "" >> $logfile 2>&1
|
---|
105 | #echo "" >> $logfile 2>&1
|
---|
106 | echo "Processing "$date" ..."
|
---|
107 | echo "Processing "$date" ..." > $logfile 2>&1
|
---|
108 | echo "Processing "$date" ..." >> $logfile2 2>&1
|
---|
109 | if [ "$certaindate" != "" ]
|
---|
110 | then
|
---|
111 | checkstring=`echo $certaindate | grep -E -o '20[0-9][0-9]\/[01][0-9]\/[0-3][0-9]'`
|
---|
112 | if [ "$checkstring" = "" ]
|
---|
113 | then
|
---|
114 | echo "Please give the variable certaindate in the correct format (YYYY/MM/DD)"
|
---|
115 | finish
|
---|
116 | fi
|
---|
117 | if [ "$certaindate" != "$date" ]
|
---|
118 | then
|
---|
119 | printprocesslog "INFO continue, as certaindate has been set to "$certaindate
|
---|
120 | echo " continue, as certaindate has been set to "$certaindate
|
---|
121 | continue
|
---|
122 | fi
|
---|
123 | fi
|
---|
124 |
|
---|
125 | # some counters
|
---|
126 | numdiff=0
|
---|
127 | numok=0
|
---|
128 | numpb=0
|
---|
129 |
|
---|
130 | # check always only $numdaysoklimit days
|
---|
131 | # and require at least $checklimit GB that have been checked
|
---|
132 | # remark: bc: expr1 < expr2: the result is 1 if expr1 is strictly less than expr2
|
---|
133 | if [ $numdaysok -ge $numdaysoklimit ] && [ $(echo " $sumdata > $checklimit " | bc -l) -eq 1 ]
|
---|
134 | then
|
---|
135 | printprocesslog "INFO more than "$numdaysoklimit" ok and more than "$checklimit" GB checked. "
|
---|
136 | continue
|
---|
137 | fi
|
---|
138 |
|
---|
139 | # get paths
|
---|
140 | date2=`echo $date | sed -e 's/\///g'`
|
---|
141 | # lprawpath="/daq/raw/"$date
|
---|
142 | lprawpath="/newdaq/raw/"$date
|
---|
143 | # lprawpath2="/loc_data/raw/"$date
|
---|
144 | lprawpath2="/daq/raw/"$date
|
---|
145 | lpziprawpath="/loc_data/zipraw/"$date
|
---|
146 | localrawpath="/scratch/from_lapalma/raw/"$date
|
---|
147 | localrawpath3="/fact/raw/"$date
|
---|
148 | # localfailpath="/archive/fact/fails/raw/"$date
|
---|
149 | localfailpath="/gpfs/fact/fact-archive/fails/raw/"$date
|
---|
150 | wuerawpath="/fact/raw/"$date
|
---|
151 | qlapath="/daq/analysis/callisto/"$date
|
---|
152 | #phidorawpath="/fhgfs/groups/app/fact-construction/raw/"$date
|
---|
153 |
|
---|
154 | # get disk usage and number of files for directory
|
---|
155 | 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"` )
|
---|
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 | if [ "$result1" != "0-0000" ] && [ "$short" != "no" ]
|
---|
345 | then
|
---|
346 | short="yes"
|
---|
347 | fi
|
---|
348 |
|
---|
349 | if [ "$short" = "yes" ]
|
---|
350 | then
|
---|
351 | printprocesslog "number of files does not yet agree in all sites ("$result1") -> do no further checking."
|
---|
352 | echo "number of files does not yet agree in all sites ("$result1") -> do no further checking." >> $logfile 2>&1
|
---|
353 | echo ""
|
---|
354 | echo "SUMMARY for "$date
|
---|
355 | echo "-----------------------"
|
---|
356 | 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) "
|
---|
357 | echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile
|
---|
358 | echo ""
|
---|
359 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
360 | echo "-----------------------" >> $logfile 2>&1
|
---|
361 | 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
|
---|
362 | echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile 2>&1
|
---|
363 | echo "" >> $logfile 2>&1
|
---|
364 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
365 | echo "-----------------------" >> $logfile2 2>&1
|
---|
366 | 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
|
---|
367 | echo " "$date" is not yet transfered completely. For more details, please check the logfile "$logfile >> $logfile2 2>&1
|
---|
368 | echo "" >> $logfile2 2>&1
|
---|
369 | #echo "number of files does not yet agree in all sites ("$result1") -> do no further checking. "
|
---|
370 | #echo "disk: "
|
---|
371 | #echo " newdaq "${newdaq[@]}
|
---|
372 | #echo " daq "${daq[@]}
|
---|
373 | #echo " data "${zip[@]}
|
---|
374 | #echo " dl00 "${dl00[@]}
|
---|
375 | #echo " wue "${wue[@]}
|
---|
376 | #echo " arch "${archive[@]}
|
---|
377 | #echo " fail "${fails[@]}
|
---|
378 | ##echo " phido "${phido[@]}
|
---|
379 | #echo "db: "
|
---|
380 | #echo " runinfo "$numruns
|
---|
381 | #echo " rsynced "$numrsynced
|
---|
382 | #echo " isdc "$numisdc
|
---|
383 | #echo " wue "$numwue
|
---|
384 | ##echo " phido "$numphido
|
---|
385 | continue
|
---|
386 | fi
|
---|
387 |
|
---|
388 | #result=$result"-"
|
---|
389 | # check du for raw files
|
---|
390 | # la palma
|
---|
391 | if ! [ ${newdaq[1]} -eq ${daq[1]} ]
|
---|
392 | then
|
---|
393 | printprocesslog "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date
|
---|
394 | echo "WARN size of data doesn't agree on newdaq ("${newdaq[1]}") and daq ("${daq[1]}") for "$date >> $logfile 2>&1
|
---|
395 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
396 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
397 | result2="1"
|
---|
398 | else
|
---|
399 | numok=`echo " $numok + 1 " | bc -l `
|
---|
400 | result2="0"
|
---|
401 | fi
|
---|
402 | # check du for zipped raw files
|
---|
403 | # dl00
|
---|
404 | if ! [ ${zip[1]} -eq ${dl00[1]} ] && [ $date2 -gt 20120307 ]
|
---|
405 | then
|
---|
406 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date
|
---|
407 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and dl00 ("${dl00[1]}") for "$date >> $logfile 2>&1
|
---|
408 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
409 | then
|
---|
410 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
411 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
412 | result2=$result2"1"
|
---|
413 | else
|
---|
414 | numok=`echo " $numok + 1 " | bc -l `
|
---|
415 | result2=$result2"0"
|
---|
416 | fi
|
---|
417 | else
|
---|
418 | numok=`echo " $numok + 1 " | bc -l `
|
---|
419 | result2=$result2"0"
|
---|
420 | fi
|
---|
421 | # archive
|
---|
422 | if ! [ ${zip[1]} -eq ${archive[1]} ]
|
---|
423 | then
|
---|
424 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date
|
---|
425 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in archive ("${archive[1]}") for "$date >> $logfile 2>&1
|
---|
426 | if ! [ ${archive[1]} -eq -1 ]
|
---|
427 | then
|
---|
428 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
429 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
430 | result2=$result2"1"
|
---|
431 | else
|
---|
432 | numok=`echo " $numok + 1 " | bc -l `
|
---|
433 | result2=$result2"0"
|
---|
434 | fi
|
---|
435 | else
|
---|
436 | numok=`echo " $numok + 1 " | bc -l `
|
---|
437 | result2=$result2"0"
|
---|
438 | fi
|
---|
439 | # wue
|
---|
440 | if ! [ ${zip[1]} -eq ${wue[1]} ]
|
---|
441 | then
|
---|
442 | printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date
|
---|
443 | echo "WARN size of data doesn't agree on data ("${zip[1]}") and in Wue ("${wue[1]}") for "$date >> $logfile 2>&1
|
---|
444 | if ! [ ${wue[1]} -eq -1 ]
|
---|
445 | then
|
---|
446 | numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
447 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
448 | result2=$result2"1"
|
---|
449 | else
|
---|
450 | numok=`echo " $numok + 1 " | bc -l `
|
---|
451 | result2=$result2"0"
|
---|
452 | fi
|
---|
453 | else
|
---|
454 | numok=`echo " $numok + 1 " | bc -l `
|
---|
455 | result2=$result2"0"
|
---|
456 | fi
|
---|
457 | ## phido
|
---|
458 | #if ! [ ${zip[1]} -eq ${phido[1]} ]
|
---|
459 | #then
|
---|
460 | # printprocesslog "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date
|
---|
461 | # echo "WARN size of data doesn't agree on data ("${zip[1]}") and on Phido ("${phido[1]}") for "$date >> $logfile 2>&1
|
---|
462 | # if ! [ ${phido[1]} -eq -1 ]
|
---|
463 | # then
|
---|
464 | # numdiff=`echo " $numdiff + 1 " | bc -l `
|
---|
465 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
466 | # result2=$result2"1"
|
---|
467 | # else
|
---|
468 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
469 | # result2=$result2"0"
|
---|
470 | # fi
|
---|
471 | #else
|
---|
472 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
473 | # result2=$result2"0"
|
---|
474 | #fi
|
---|
475 | #result=$result"-"
|
---|
476 |
|
---|
477 | # check DB (only starting from 8.3.2012) (if-clause to be removed later)
|
---|
478 | if [ $date2 -gt 20120307 ]
|
---|
479 | then
|
---|
480 | # lp
|
---|
481 | if ! [ $numruns -eq ${newdaq[0]} ]
|
---|
482 | then
|
---|
483 | printprocesslog "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")"
|
---|
484 | echo "WARN number of runs on newdaq ("${newdaq[0]}") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
485 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
486 | result3="1"
|
---|
487 | else
|
---|
488 | numok=`echo " $numok + 1 " | bc -l `
|
---|
489 | result3="0"
|
---|
490 | fi
|
---|
491 | # dl00
|
---|
492 | if ! [ $numruns -eq $numrsynced ]
|
---|
493 | then
|
---|
494 | printprocesslog "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
495 | echo "WARN number of rsynced runs ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
496 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
497 | result3=$result3"1"
|
---|
498 | else
|
---|
499 | numok=`echo " $numok + 1 " | bc -l `
|
---|
500 | result3=$result3"0"
|
---|
501 | fi
|
---|
502 | # archive
|
---|
503 | if ! [ $numruns -eq $numisdc ]
|
---|
504 | then
|
---|
505 | printprocesslog "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")"
|
---|
506 | echo "WARN number of ingested files in archive ("$numisdc") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
507 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
508 | result3=$result3"1"
|
---|
509 | else
|
---|
510 | numok=`echo " $numok + 1 " | bc -l `
|
---|
511 | result3=$result3"0"
|
---|
512 | fi
|
---|
513 | # wue
|
---|
514 | if ! [ $numruns -eq $numwue ]
|
---|
515 | then
|
---|
516 | printprocesslog "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
517 | echo "WARN number of backuped in Wue ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
518 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
519 | result3=$result3"1"
|
---|
520 | else
|
---|
521 | numok=`echo " $numok + 1 " | bc -l `
|
---|
522 | result3=$result3"0"
|
---|
523 | fi
|
---|
524 | ## phido
|
---|
525 | #if ! [ $numruns -eq $numphido ]
|
---|
526 | #then
|
---|
527 | # printprocesslog "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")"
|
---|
528 | # echo "WARN number of backuped on Phido ("$numrsynced") not equal to number of runs ("$numruns")" >> $logfile 2>&1
|
---|
529 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
530 | # result3=$result3"1"
|
---|
531 | #else
|
---|
532 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
533 | # result3=$result3"0"
|
---|
534 | #fi
|
---|
535 | fi
|
---|
536 |
|
---|
537 | #numdiff=0 # add for debugging so that single file sizes are not checked
|
---|
538 | printprocesslog "numdiff: "$numdiff
|
---|
539 | printprocesslog "INFO numok: "$numok
|
---|
540 | printprocesslog "INFO numpb: "$numpb
|
---|
541 | echo "numdiff: "$numdiff >> $logfile 2>&1
|
---|
542 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
543 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
544 | #if [ $numdiff -gt 0 ]
|
---|
545 | if [ $numdiff -ge 0 ]
|
---|
546 | then
|
---|
547 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2
|
---|
548 | runs=( `sendquery` )
|
---|
549 | archivediffcounter=0
|
---|
550 | archiveokcounter=0
|
---|
551 | wuediffcounter=0
|
---|
552 | wueokcounter=0
|
---|
553 | #phidodiffcounter=0
|
---|
554 | #phidookcounter=0
|
---|
555 | dl00diffcounter=0
|
---|
556 | dl00okcounter=0
|
---|
557 | daqdiffcounter=0
|
---|
558 | daqokcounter=0
|
---|
559 | printprocesslog "INFO found "${#runs[@]}" rawfiles in DB."
|
---|
560 | echo "INFO found "${#runs[@]}" rawfiles in DB." >> $logfile 2>&1
|
---|
561 | for run in ${runs[@]}
|
---|
562 | do
|
---|
563 | rawfile=$date2"_"`printf %03d $run`".fits"
|
---|
564 | #rawfile2=$rawfile".gz"
|
---|
565 | rawfile2=$rawfile".*z"
|
---|
566 | printprocesslog "INFO checking "$rawfile
|
---|
567 |
|
---|
568 | # get file sizes for run
|
---|
569 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
570 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
571 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
572 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
573 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
574 | then
|
---|
575 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
576 | fi
|
---|
577 | if ! [ ${archive[1]} -eq -1 ]
|
---|
578 | then
|
---|
579 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
580 | fi
|
---|
581 | if ! [ ${fails[1]} -eq -1 ]
|
---|
582 | then
|
---|
583 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
584 | fi
|
---|
585 | if ! [ ${wue[1]} -eq -1 ]
|
---|
586 | then
|
---|
587 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
588 | fi
|
---|
589 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
590 | #then
|
---|
591 | # 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 }'"` )
|
---|
592 | #fi
|
---|
593 |
|
---|
594 | # check file sizes for run
|
---|
595 | # lp
|
---|
596 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
597 | then
|
---|
598 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
599 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
600 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
601 | else
|
---|
602 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
603 | fi
|
---|
604 | # dl00
|
---|
605 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
606 | then
|
---|
607 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
608 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
609 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
610 | else
|
---|
611 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
612 | fi
|
---|
613 | # archive
|
---|
614 | #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
|
---|
615 | #if [ ${archive[1]} -ne -1 ] && [ "$sizezip" != "$sizearchive" -o "$sizezip" != "$sizefails" ]
|
---|
616 | if [ ${archive[1]} -ne -1 -a "$sizezip" != "$sizearchive" -a "$sizezip" != "$sizefails" ]
|
---|
617 | then
|
---|
618 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
619 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
620 | #echo " "$sizezip"-"$sizearchive"-"${archive[1]}"-"$sizezip"-"$sizefails"-"${fails[1]}
|
---|
621 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
622 | else
|
---|
623 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
624 | fi
|
---|
625 | # wue
|
---|
626 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
627 | then
|
---|
628 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
629 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
630 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
631 | else
|
---|
632 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
633 | fi
|
---|
634 | ## phido
|
---|
635 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
636 | #then
|
---|
637 | # printprocesslog " "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
638 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
639 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
640 | #else
|
---|
641 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
642 | #fi
|
---|
643 | done
|
---|
644 | query="SELECT fRunID FROM RunInfo WHERE fNight="$date2" AND fHasDrsFile=1"
|
---|
645 | drsruns=( `sendquery` )
|
---|
646 | printprocesslog "INFO found "${#drsruns[@]}" drsfiles in DB."
|
---|
647 | echo "INFO found "${#drsruns[@]}" drsfiles in DB." >> $logfile 2>&1
|
---|
648 | for drsrun in ${drsruns[@]}
|
---|
649 | do
|
---|
650 | rawfile=$date2"_"`printf %03d $drsrun`".drs.fits"
|
---|
651 | #rawfile2=$rawfile".gz"
|
---|
652 | rawfile2=$rawfile".*z"
|
---|
653 | # get file sizes for run
|
---|
654 | #sizenewdaq=( `ssh fact@161.72.93.131 "ls -l ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
655 | sizenewdaq=( `ssh fact@161.72.93.131 "ls -lH ${lprawpath}/${rawfile} 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
656 | sizedaq=( `ssh fact@161.72.93.131 "ls -l $lprawpath2/$rawfile 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
657 | sizezip=( `ssh fact@161.72.93.131 "ls -l $lpziprawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
658 | if ! [ ${dl00[1]} -eq -1 ]
|
---|
659 | then
|
---|
660 | sizedl00=( `ls -l $localrawpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
661 | fi
|
---|
662 | if ! [ ${archive[1]} -eq -1 ]
|
---|
663 | then
|
---|
664 | sizearchive=( `ls -lH $localrawpath3/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
665 | fi
|
---|
666 | if ! [ ${fails[1]} -eq -1 ]
|
---|
667 | then
|
---|
668 | sizefails=( `ls -lH $localfailpath/$rawfile2 2>/dev/null | awk '{ print \$5 }'` )
|
---|
669 | fi
|
---|
670 | if ! [ ${wue[1]} -eq -1 ]
|
---|
671 | then
|
---|
672 | sizewue=( `ssh operator@coma.astro.uni-wuerzburg.de "ls -l $wuerawpath/$rawfile2 2>/dev/null | awk '{ print \\\$5 }'"` )
|
---|
673 | fi
|
---|
674 | #if ! [ ${phido[1]} -eq -1 ]
|
---|
675 | #then
|
---|
676 | # 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 }'"` )
|
---|
677 | #fi
|
---|
678 |
|
---|
679 | # check file sizes for run
|
---|
680 | # lp
|
---|
681 | if ! [ "$sizenewdaq" = "$sizedaq" ]
|
---|
682 | then
|
---|
683 | printprocesslog "WARN "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")"
|
---|
684 | echo " "$rawfile" newdaq("$sizenewdaq") daq("$sizedaq")" >> $logfile 2>&1
|
---|
685 | daqdiffcounter=`echo " $daqdiffcounter + 1 " | bc -l `
|
---|
686 | else
|
---|
687 | daqokcounter=`echo " $daqokcounter + 1 " | bc -l `
|
---|
688 | fi
|
---|
689 | # dl00
|
---|
690 | if ! [ "$sizezip" = "$sizedl00" ] && ! [ ${dl00[1]} -eq -1 ]
|
---|
691 | then
|
---|
692 | printprocesslog "WARN "$rawfile2" data("$sizezip") dl00("$sizedl00")"
|
---|
693 | echo " "$rawfile2" data("$sizezip") dl00("$sizedl00")" >> $logfile 2>&1
|
---|
694 | dl00diffcounter=`echo " $dl00diffcounter + 1 " | bc -l `
|
---|
695 | else
|
---|
696 | dl00okcounter=`echo " $dl00okcounter + 1 " | bc -l `
|
---|
697 | fi
|
---|
698 | #if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 ]
|
---|
699 | if [ "$sizezip" != "$sizearchive" -a ${archive[1]} -ne -1 -a "$sizearchive" != "" ] || [ "$sizezip" != "$sizefails" -a ${fails[1]} -ne -1 -a "$sizefails" != "" ]
|
---|
700 | then
|
---|
701 | printprocesslog "WARN "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")"
|
---|
702 | echo " "$rawfile2" data("$sizezip") archive("$sizearchive"/"$sizefails")" >> $logfile 2>&1
|
---|
703 | archivediffcounter=`echo " $archivediffcounter + 1 " | bc -l `
|
---|
704 | else
|
---|
705 | archiveokcounter=`echo " $archiveokcounter + 1 " | bc -l `
|
---|
706 | fi
|
---|
707 | # wue
|
---|
708 | if ! [ "$sizezip" = "$sizewue" ] && ! [ ${wue[1]} -eq -1 ]
|
---|
709 | then
|
---|
710 | printprocesslog "WARN "$rawfile2" data("$sizezip") wue("$sizewue")"
|
---|
711 | echo " "$rawfile2" data("$sizezip") wue("$sizewue")" >> $logfile 2>&1
|
---|
712 | wuediffcounter=`echo " $wuediffcounter + 1 " | bc -l `
|
---|
713 | else
|
---|
714 | wueokcounter=`echo " $wueokcounter + 1 " | bc -l `
|
---|
715 | fi
|
---|
716 | ## phido
|
---|
717 | #if ! [ "$sizezip" = "$sizephido" ] && ! [ ${phido[1]} -eq -1 ]
|
---|
718 | #then
|
---|
719 | # printprocesslog "WARN "$rawfile2" data("$sizezip") phido("$sizephido")"
|
---|
720 | # echo " "$rawfile2" data("$sizezip") phido("$sizephido")" >> $logfile 2>&1
|
---|
721 | # phidodiffcounter=`echo " $phidodiffcounter + 1 " | bc -l `
|
---|
722 | #else
|
---|
723 | # phidookcounter=`echo " $phidookcounter + 1 " | bc -l `
|
---|
724 | #fi
|
---|
725 | done
|
---|
726 |
|
---|
727 | #result=$result"-"
|
---|
728 | # raw files
|
---|
729 | if [ $daqokcounter -eq ${daq[0]} ]
|
---|
730 | then
|
---|
731 | numok=`echo " $numok + 1 " | bc -l `
|
---|
732 | result4="0"
|
---|
733 | else
|
---|
734 | result4="1"
|
---|
735 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
736 | fi
|
---|
737 | # zipped files
|
---|
738 | # dl00
|
---|
739 | if [ $dl00okcounter -eq ${dl00[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 | # archive
|
---|
748 | # daq had been used, because archive[0] doesn't include fails[0]
|
---|
749 | #if [ $archiveokcounter -eq ${newdaq[0]} ]
|
---|
750 | # archive[0] had been used, because newdaq[0] might be empty
|
---|
751 | # in case the data was taken on data
|
---|
752 | #if [ $archiveokcounter -eq ${archive[0]} ]
|
---|
753 | # compare with daq[0] as there should be always data on data
|
---|
754 | if [ $archiveokcounter -eq ${daq[0]} ]
|
---|
755 | then
|
---|
756 | result4=$result4"0"
|
---|
757 | numok=`echo " $numok + 1 " | bc -l `
|
---|
758 | else
|
---|
759 | result4=$result4"1"
|
---|
760 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
761 | fi
|
---|
762 | # wue
|
---|
763 | if [ $wueokcounter -eq ${wue[0]} ]
|
---|
764 | then
|
---|
765 | result4=$result4"0"
|
---|
766 | numok=`echo " $numok + 1 " | bc -l `
|
---|
767 | else
|
---|
768 | result4=$result4"1"
|
---|
769 | numpb=`echo " $numpb + 1 " | bc -l `
|
---|
770 | fi
|
---|
771 | ## phido
|
---|
772 | #if [ $phidookcounter -eq ${phido[0]} ]
|
---|
773 | #then
|
---|
774 | # result4=$result4"0"
|
---|
775 | # numok=`echo " $numok + 1 " | bc -l `
|
---|
776 | #else
|
---|
777 | # result4=$result4"1"
|
---|
778 | # numpb=`echo " $numpb + 1 " | bc -l `
|
---|
779 | #fi
|
---|
780 | printprocesslog "INFO "$daqokcounter" files are ok on daq (raw)."
|
---|
781 | printprocesslog "INFO "$dl00okcounter" files are ok on dl00."
|
---|
782 | printprocesslog "INFO "$wueokcounter" files are ok in Wue."
|
---|
783 | printprocesslog "INFO "$archiveokcounter" files are ok in the archive."
|
---|
784 | #printprocesslog "INFO "$phidookcounter" files are ok on Phido."
|
---|
785 | echo "INFO "$daqokcounter" files are ok on daq (raw)." >> $logfile 2>&1
|
---|
786 | echo "INFO "$dl00okcounter" files are ok on dl00." >> $logfile 2>&1
|
---|
787 | echo "INFO "$wueokcounter" files are ok in Wue." >> $logfile 2>&1
|
---|
788 | echo "INFO "$archiveokcounter" files are ok in the archive." >> $logfile 2>&1
|
---|
789 | #echo "INFO "$phidookcounter" files are ok on Phido." >> $logfile 2>&1
|
---|
790 | if [ $daqdiffcounter -gt 0 ]
|
---|
791 | then
|
---|
792 | printprocesslog "WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
793 | echo "WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
794 | else
|
---|
795 | printprocesslog "INFO "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
796 | echo "INFO "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
797 | fi
|
---|
798 | if [ $dl00diffcounter -gt 0 ]
|
---|
799 | then
|
---|
800 | printprocesslog "WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
801 | echo "WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
802 | else
|
---|
803 | printprocesslog "INFO "$dl00diffcounter" files have a different size on dl00."
|
---|
804 | echo "INFO "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
805 | fi
|
---|
806 | if [ $wuediffcounter -gt 0 ]
|
---|
807 | then
|
---|
808 | printprocesslog "WARN "$wuediffcounter" files have a different size in Wue."
|
---|
809 | echo "WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
810 | else
|
---|
811 | printprocesslog "INFO "$wuediffcounter" files have a different size in Wue."
|
---|
812 | echo "INFO "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
813 | fi
|
---|
814 | if [ $archivediffcounter -gt 0 ]
|
---|
815 | then
|
---|
816 | printprocesslog "WARN "$archivediffcounter" files have a different size in the archive."
|
---|
817 | echo "WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
818 | else
|
---|
819 | printprocesslog "INFO "$archivediffcounter" files have a different size in the archive."
|
---|
820 | echo "INFO "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
821 | fi
|
---|
822 | #printprocesslog "WARN "$phidodiffcounter" files have a different size on Phido."
|
---|
823 | #echo "WARN "$phidodiffcounter" files have a different size on Phido." >> $logfile 2>&1
|
---|
824 | fi
|
---|
825 |
|
---|
826 | # print summary:
|
---|
827 | printprocesslog "INFO day ok: "$numdaysok
|
---|
828 | printprocesslog "INFO numok: "$numok
|
---|
829 | printprocesslog "INFO numpb: "$numpb
|
---|
830 | printprocesslog "result:"
|
---|
831 | printprocesslog "(qla-#files-dudir-db-filesize)"
|
---|
832 | #printprocesslog " ldawp-ldawp-ldawp-ldawp"
|
---|
833 | printprocesslog " q-ldaw-ldaw-ldaw-ldaw"
|
---|
834 | printprocesslog " "$result1"-"$result2"-"$result3"-"$result4
|
---|
835 | echo "INFO day ok: "$numdaysok >> $logfile 2>&1
|
---|
836 | echo "INFO numok: "$numok >> $logfile 2>&1
|
---|
837 | echo "INFO numpb: "$numpb >> $logfile 2>&1
|
---|
838 | echo "result:" >> $logfile 2>&1
|
---|
839 | echo "(qla-#files-dudir-db-filesize)" >> $logfile 2>&1
|
---|
840 | #echo " ldawp-ldawp-ldawp-ldawp" >> $logfile 2>&1
|
---|
841 | echo " q-ldaw-ldaw-ldaw-ldaw" >> $logfile 2>&1
|
---|
842 | echo " "$result1"-"$result2"-"$result3"-"$result4 >> $logfile 2>&1
|
---|
843 | sumdatanew=`echo " ( ${daq[1]} + ${zip[1]} ) / 1024 / 1024 / 1024 " | bc -l | cut -d. -f1`
|
---|
844 | sumdata=`echo " $sumdata + $sumdatanew " | bc -l | cut -d. -f1`
|
---|
845 | printprocesslog "checked alread "$sumdata" GB. "$sumdatanew" "${daq[1]}" "${zip[1]}
|
---|
846 | if [ $numpb -lt 4 ]
|
---|
847 | then
|
---|
848 | numdaysok=`echo " $numdaysok + 1 " | bc -l `
|
---|
849 | fi
|
---|
850 |
|
---|
851 | echo "SUMMARY for "$date
|
---|
852 | echo "-----------------------"
|
---|
853 | echo "SUMMARY for "$date >> $logfile 2>&1
|
---|
854 | echo "-----------------------" >> $logfile 2>&1
|
---|
855 | echo "SUMMARY for "$date >> $logfile2 2>&1
|
---|
856 | echo "-----------------------" >> $logfile2 2>&1
|
---|
857 | #echo "res1:"$result1
|
---|
858 | #echo "res3:"$result3
|
---|
859 | #echo "res4:"$result4
|
---|
860 | #echo "arch:"${archive[0]}
|
---|
861 | #echo "isdc:"$numisdc
|
---|
862 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0000" ] && [ "$result4" = "0000" ]
|
---|
863 | then
|
---|
864 | echo " EVERYTHING is ok. "$date" can be deleted. "
|
---|
865 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
866 | echo " EVERYTHING is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
867 | echo " Details in the logfile "$logfile
|
---|
868 | echo " Details in the logfile "$logfile >> $logfile 2>&1
|
---|
869 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
870 | sendemail="yes"
|
---|
871 | else
|
---|
872 | if [ "$result1" = "0-0000" ] && [ "$result3" = "0010" ] && [ "$result4" = "0000" ] && [ ${archive[0]} -eq $numisdc ]
|
---|
873 | then
|
---|
874 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. "
|
---|
875 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile 2>&1
|
---|
876 | echo " "${fails[0]}" file(s) corrupt (fails folder), but files are transfered correctly. " >> $logfile2 2>&1
|
---|
877 | echo " TRANSFER is ok. "$date" can be deleted. "
|
---|
878 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile 2>&1
|
---|
879 | echo " TRANSFER is ok. "$date" can be deleted. " >> $logfile2 2>&1
|
---|
880 | echo " Details in the logfile "$logfile
|
---|
881 | echo " Details in the logfile "$logfile >> $logfile 2>&1
|
---|
882 | echo " Details in the logfile "$logfile >> $logfile2 2>&1
|
---|
883 | sendemail="yes"
|
---|
884 | else
|
---|
885 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile
|
---|
886 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile 2>&1
|
---|
887 | echo " "$date" is not yet transfered completely. Please check the logfile "$logfile >> $logfile2 2>&1
|
---|
888 | echo " resetting jobs in the DB might be needed."
|
---|
889 | echo " resetting jobs in the DB might be needed." >> $logfile 2>&1
|
---|
890 | echo " resetting jobs in the DB might be needed." >> $logfile2 2>&1
|
---|
891 | fi
|
---|
892 | fi
|
---|
893 | if [ $daqdiffcounter -gt 0 ]
|
---|
894 | then
|
---|
895 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)."
|
---|
896 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile 2>&1
|
---|
897 | echo " WARN "$daqdiffcounter" files have a different size on daq (raw)." >> $logfile2 2>&1
|
---|
898 | fi
|
---|
899 | if [ $dl00diffcounter -gt 0 ]
|
---|
900 | then
|
---|
901 | echo " WARN "$dl00diffcounter" files have a different size on dl00."
|
---|
902 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile 2>&1
|
---|
903 | echo " WARN "$dl00diffcounter" files have a different size on dl00." >> $logfile2 2>&1
|
---|
904 | fi
|
---|
905 | if [ $wuediffcounter -gt 0 ]
|
---|
906 | then
|
---|
907 | echo " WARN "$wuediffcounter" files have a different size in Wue."
|
---|
908 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile 2>&1
|
---|
909 | echo " WARN "$wuediffcounter" files have a different size in Wue." >> $logfile2 2>&1
|
---|
910 | fi
|
---|
911 | if [ $archivediffcounter -gt 0 ]
|
---|
912 | then
|
---|
913 | echo " WARN "$archivediffcounter" files have a different size in the archive."
|
---|
914 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile 2>&1
|
---|
915 | echo " WARN "$archivediffcounter" files have a different size in the archive." >> $logfile2 2>&1
|
---|
916 | fi
|
---|
917 | if ! [ $numdatruns -eq $qla ]
|
---|
918 | then
|
---|
919 | echo "WARN not all data runs are processed yet by the QLA. "
|
---|
920 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile 2>&1
|
---|
921 | echo "WARN not all data runs are processed yet by the QLA. " >> $logfile2 2>&1
|
---|
922 | fi
|
---|
923 | echo ""
|
---|
924 | echo "" >> $logfile 2>&1
|
---|
925 | echo "" >> $logfile2 2>&1
|
---|
926 | done
|
---|
927 |
|
---|
928 | #sendemail="yes"
|
---|
929 | if [ "$sendemail" = "yes" ]
|
---|
930 | then
|
---|
931 | echo ""
|
---|
932 | echo "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
933 | printprocesslog "INFO send email with "$logfile2"to shift@fact-project.org "
|
---|
934 | cat $logfile2 | mail -s "testmail for info on deleting data" shift@fact-project.org
|
---|
935 | fi
|
---|
936 |
|
---|
937 | printprocesslog "INFO finished $0"
|
---|
938 |
|
---|