Last change
on this file since 41 was 37, checked in by gegorbet, 6 years ago |
gridctl mods for mysqli and aucsolutions, plus new text for crontabs and cronic
|
-
Property svn:keywords
set to
LastChangedDate Author
|
File size:
880 bytes
|
Line | |
---|
1 | /bin/cronic
|
---|
2 | #!/bin/bash
|
---|
3 |
|
---|
4 | # Cronic v2 - cron job report wrapper
|
---|
5 | # Copyright 2007 Chuck Houpt. No rights reserved, whatsoever.
|
---|
6 | # Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
---|
7 |
|
---|
8 | set -eu
|
---|
9 |
|
---|
10 | OUT=/tmp/cronic.out.$$
|
---|
11 | ERR=/tmp/cronic.err.$$
|
---|
12 | TRACE=/tmp/cronic.trace.$$
|
---|
13 |
|
---|
14 | set +e
|
---|
15 | "$@" >$OUT 2>$TRACE
|
---|
16 | RESULT=$?
|
---|
17 | set -e
|
---|
18 |
|
---|
19 | PATTERN="^${PS4:0:1}\\+${PS4:1}"
|
---|
20 | if grep -aq "$PATTERN" $TRACE
|
---|
21 | then
|
---|
22 | ! grep -av "$PATTERN" $TRACE > $ERR
|
---|
23 | else
|
---|
24 | ERR=$TRACE
|
---|
25 | fi
|
---|
26 |
|
---|
27 | if [ $RESULT -ne 0 -o -s "$ERR" ]
|
---|
28 | then
|
---|
29 | echo "Cronic detected failure or error output for the command:"
|
---|
30 | echo "$@"
|
---|
31 | echo
|
---|
32 | echo "RESULT CODE: $RESULT"
|
---|
33 | echo
|
---|
34 | echo "ERROR OUTPUT:"
|
---|
35 | cat "$ERR"
|
---|
36 | echo
|
---|
37 | echo "STANDARD OUTPUT:"
|
---|
38 | cat "$OUT"
|
---|
39 | if [ $TRACE != $ERR ]
|
---|
40 | then
|
---|
41 | echo
|
---|
42 | echo "TRACE-ERROR OUTPUT:"
|
---|
43 | cat "$TRACE"
|
---|
44 | fi
|
---|
45 | fi
|
---|
46 |
|
---|
47 | rm -f "$OUT"
|
---|
48 | rm -f "$ERR"
|
---|
49 | rm -f "$TRACE"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.