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