comparison bin/cronic @ 679:8fa04c2a9896

[cronic] update
author nanaya <me@nanaya.pro>
date Thu, 28 Apr 2022 17:13:12 +0900
parents 0c2d6458248e
children
comparison
equal deleted inserted replaced
678:12fe76be3071 679:8fa04c2a9896
2 2
3 # Mod by edogawaconan: 3 # Mod by edogawaconan:
4 # - `/usr/bin/env bash` 4 # - `/usr/bin/env bash`
5 # Source: http://habilis.net/cronic/ 5 # Source: http://habilis.net/cronic/
6 # 6 #
7 # Cronic v2 - cron job report wrapper 7 # Cronic v3 - cron job report wrapper
8 # Copyright 2007 Chuck Houpt. No rights reserved, whatsoever. 8 # Copyright 2007-2016 Chuck Houpt. No rights reserved, whatsoever.
9 # Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/ 9 # Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/
10 10
11 set -eu 11 set -eu
12 12
13 OUT=/tmp/cronic.out.$$ 13 TMP=$(mktemp -d)
14 ERR=/tmp/cronic.err.$$ 14 OUT=$TMP/cronic.out
15 TRACE=/tmp/cronic.trace.$$ 15 ERR=$TMP/cronic.err
16 TRACE=$TMP/cronic.trace
16 17
17 set +e 18 set +e
18 "$@" >$OUT 2>$TRACE 19 "$@" >$OUT 2>$TRACE
19 RESULT=$? 20 RESULT=$?
20 set -e 21 set -e
45 echo "TRACE-ERROR OUTPUT:" 46 echo "TRACE-ERROR OUTPUT:"
46 cat "$TRACE" 47 cat "$TRACE"
47 fi 48 fi
48 fi 49 fi
49 50
50 rm -f "$OUT" 51 rm -rf "$TMP"
51 rm -f "$ERR"
52 rm -f "$TRACE"