25b19b6278756df7090f0de0f30e995ea5899b50
[u/mrichter/AliRoot.git] / TPC / scripts / filterRecLog.sh
1 # marian.ivanov@cern.ch
2 # Filter error logs 
3 # Input   - errRec.logs  - text file with the list of error logs
4 # Output  - abort.log      - text file with the seg.faults runs
5 #         - abortout.log   - text file with the output of the seg.fault runs
6 #                          - the err.log and out.log suppose to be in the same directory
7 #         -syswatchAbort.log
8
9 isOK=0 
10 nonOK=0
11 #
12 rm abort.log
13 rm abortout.log
14 rm syswatchAbort.log
15 rm syswatchAll.log
16 echo hname/C:sname/C:id0/I:id1/I:id2/I:first/I:stampSec/I:mi.fMemUsed/F:mi.fSwapUsed/F:cI.fUser/F:cI.fSys/F:pI.fMemResident/F:pI.fMemVirtual/F:pI.fCpuUser/F:pI.fCpuSys/F:stampOldSec/I:miOld.fMemUsed/F:miOld.fSwapUsed/F:cIOld.fUser/F:cIOld.fSys/F:pIOld.fMemResident/F:pIOld.fMemVirtual/F:pIOld.fCpuUser/F:pIOld.fCpuSys/F > syswatchAbort.log
17
18 echo hname/C:sname/C:id0/I:id1/I:id2/I:first/I:stampSec/I:mi.fMemUsed/F:mi.fSwapUsed/F:cI.fUser/F:cI.fSys/F:pI.fMemResident/F:pI.fMemVirtual/F:pI.fCpuUser/F:pI.fCpuSys/F:stampOldSec/I:miOld.fMemUsed/F:miOld.fSwapUsed/F:cIOld.fUserF:cIOld.fSys/F:pIOld.fMemResident/F:pIOld.fMemVirtual/F:pIOld.fCpuUser/F:pIOld.fCpuSys/F > syswatchAll.log
19
20 #
21 for efile in `cat errRec.log`  ;do
22  xxx=`cat $efile| grep segmentation`
23  xxx=$xxx`cat $efile| grep Aborted`
24  sysfile=`echo $efile| sed s_err.log_syswatch.log_`
25  # 
26  if [ -z "$xxx" ]
27  then
28   let isOK=isOK+1
29   else
30   let nonOK=nonOK+1
31   echo nonOK=$nonOK
32   echo "$efile" >>abort.log
33   echo $efile
34   ofile=`echo $efile| sed s_err_out_`
35   cat $ofile   >> abortout.log
36   cat $sysfile | grep -v hname\/C:sname\/C: >> syswatchAbort.log
37  fi
38   cat $sysfile | grep -v hname\/C:sname\/ >> syswatchAll.log
39 done; 
40
41 #get the list
42 echo isOK=$isOK nonOK=$nonOK