diff bin/cronic @ 679:8fa04c2a9896

[cronic] update
author nanaya <me@nanaya.pro>
date Thu, 28 Apr 2022 17:13:12 +0900
parents 0c2d6458248e
children
line wrap: on
line diff
--- a/bin/cronic	Mon Apr 11 22:58:30 2022 +0900
+++ b/bin/cronic	Thu Apr 28 17:13:12 2022 +0900
@@ -4,15 +4,16 @@
 # - `/usr/bin/env bash`
 # Source: http://habilis.net/cronic/
 #
-# Cronic v2 - cron job report wrapper
-# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever.
+# Cronic v3 - cron job report wrapper
+# Copyright 2007-2016 Chuck Houpt. No rights reserved, whatsoever.
 # Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/
 
 set -eu
 
-OUT=/tmp/cronic.out.$$
-ERR=/tmp/cronic.err.$$
-TRACE=/tmp/cronic.trace.$$
+TMP=$(mktemp -d)
+OUT=$TMP/cronic.out
+ERR=$TMP/cronic.err
+TRACE=$TMP/cronic.trace
 
 set +e
 "$@" >$OUT 2>$TRACE
@@ -47,6 +48,4 @@
     fi
 fi
 
-rm -f "$OUT"
-rm -f "$ERR"
-rm -f "$TRACE"
+rm -rf "$TMP"