-
Notifications
You must be signed in to change notification settings - Fork 4
/
errorcheck.txt
executable file
·50 lines (42 loc) · 1.63 KB
/
errorcheck.txt
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
39
40
41
42
43
44
45
46
47
48
49
##########################################################################
## Script to check for errors in the RedDog pipeline ##
## Lesley Raven - 09/12/2014 ##
##########################################################################
#Copyright (c) 2015, Lesley Raven, David Edwards, Bernie Pope, Kat Holt
#All rights reserved. (see README.txt for more details)
### Enter location of your log directory
log_dir=log
if [ -s tmp_log.txt ]; then rm tmp_log.txt; fi
### Check for errors
echo "Checking $log_dir...."
grep -ir 'EOF \|CANCELLED\|FAILED\| EXIT \|TIME LIMIT\|KILLED\|Warning\|malformatted\|died\|error \|error while loading\|cutoff is higher\|failed to \|No such file' $log_dir/* | sed 's/:/\t/g' >> tmp_log.txt
#grep -ir "failed" log/*
### Print summary of errors
n_err=`cat tmp_log.txt | wc -l`
echo ""
if [ -s tmp_log.txt ]
then
echo "You have $n_err errors! :("
echo ""
cat tmp_log.txt | cut -f3-20 | sort | uniq -c
echo ""
echo "See tmp_log.txt for file names"
else
echo "You have NO errors! YAYE!"
if [ -s tmp_log.txt ]; then rm tmp_log.txt; fi
fi
echo ""
if grep -q 'IO Error' tmp_log.txt; then echo "IO Error: Check disk usage, re-run pipeline the communication has been disrupted"; else :;fi
### Find first pipeline step with an error
res=`cat RedDog_config.py | grep ": {" | tr ":{" '_' | sed 's/"//g' | sed 's/_//g' | tr '\n' ' '`
for i in $res; do
grep -q $i tmp_log.txt
if [ $? -eq 0 ]
then
echo First step with an error is: $i
cat tmp_log.txt | grep $i | head -2
exit 0
else
continue
fi
done