Skip to content

Commit

Permalink
Merge branch 'justincase-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Nov 18, 2024
2 parents a6c5b34 + 34c3ec7 commit 6599bdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ broken, it isn't cron. The only solution left is a work-around.

## The Cure: Cronic

Download: [cronic](http://habilis.net/cronic/cronic) v2
Download: [cronic](http://habilis.net/cronic/cronic) v3

Cronic is a small shim shell script for wrapping cron jobs so that cron only sends email
when an error has occurred. Cronic defines an error as any non-trace error output or a
Expand Down Expand Up @@ -110,6 +110,7 @@ cp: data2: Permission denied

### Version History

- v3 - Use mktemp-d to avoid race-conditions and security problems.
- v2 - Corrected command evaluation, so shell meta-chars are preserved correctly (Thanks to Frank Wallingford for the fix).
- v1 - Initial release.

Expand Down
15 changes: 7 additions & 8 deletions cronic
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash

# 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
Expand Down Expand Up @@ -43,6 +44,4 @@ if [ $RESULT -ne 0 -o -s "$ERR" ]
fi
fi

rm -f "$OUT"
rm -f "$ERR"
rm -f "$TRACE"
rm -rf "$TMP"

0 comments on commit 6599bdd

Please sign in to comment.