forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimlogcheck.sh
More file actions
executable file
·38 lines (29 loc) · 798 Bytes
/
Copy pathsimlogcheck.sh
File metadata and controls
executable file
·38 lines (29 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash -l
set -x
# a script checking logfiles for signs of errors
# can be used to detect most common errors automatically
# returns/exits with 0 if no problem
error=0
for file in "$@"; do
echo "looking into ${file}"
fileerrors=0
# We don't want to see "Error" or "ERROR" messages
value=$(grep "Error" ${file})
if [ -n "${value}" ]; then
echo "check for Error failed"
let filererrors=fileerrors+1
fi
value=$(grep "ERROR" ${file})
if [ -n "${value}" ]; then
echo "check for ERROR failed"
let fileerrors=fileerrors+1
fi
if [ "${fileerrors}" != "0" ]; then
echo "Found problem in file ${file}"
echo "<--- START OF FILE ${file} ---"
cat ${file}
echo "**** END OF FILE ${file} ****>"
fi
let error=fileerrors+error
done
exit ${error}