1 | #!/bin/sh
|
---|
2 | #
|
---|
3 | # ========================================================================
|
---|
4 | #
|
---|
5 | # *
|
---|
6 | # * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
7 | # * Software. It is distributed to you in the hope that it can be a useful
|
---|
8 | # * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
9 | # * It is distributed WITHOUT ANY WARRANTY.
|
---|
10 | # *
|
---|
11 | # * Permission to use, copy, modify and distribute this software and its
|
---|
12 | # * documentation for any purpose is hereby granted without fee,
|
---|
13 | # * provided that the above copyright notice appear in all copies and
|
---|
14 | # * that both that copyright notice and this permission notice appear
|
---|
15 | # * in supporting documentation. It is provided "as is" without express
|
---|
16 | # * or implied warranty.
|
---|
17 | # *
|
---|
18 | #
|
---|
19 | #
|
---|
20 | # Author(s): Daniela Dorner 08/2006 <mailto:dorner@astro.uni-wuerzburg.de>
|
---|
21 | #
|
---|
22 | # Copyright: MAGIC Software Development, 2000-2007
|
---|
23 | #
|
---|
24 | #
|
---|
25 | # ========================================================================
|
---|
26 | #
|
---|
27 | # This script checks, if there are WARNs or ERRORs in the processlog of
|
---|
28 | # the last night and sends them to the emailadresse(s) in $erradr
|
---|
29 | #
|
---|
30 |
|
---|
31 | source `dirname $0`/sourcefile
|
---|
32 | printprocesslog "INFO starting $0"
|
---|
33 |
|
---|
34 | oldprocesslog=$processlogpath/process`date +%F --date="-1day"`.log
|
---|
35 |
|
---|
36 | if grep WARN $oldprocesslog >/dev/null
|
---|
37 | then
|
---|
38 | grep WARN $oldprocesslog | nail -s 'found warnings in '$oldprocesslog $erradrs
|
---|
39 | fi
|
---|
40 |
|
---|
41 | if grep ERROR $oldprocesslog >/dev/null
|
---|
42 | then
|
---|
43 | grep ERROR $oldprocesslog | nail -s 'found errors in '$oldprocesslog $erradrs
|
---|
44 | fi
|
---|
45 |
|
---|
46 | printprocesslog "INFO finished $0"
|
---|
47 |
|
---|