Last active
January 29, 2019 10:02
-
-
Save jangaraj/c4c9262fe04156a40b02 to your computer and use it in GitHub Desktop.
Basic cron wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reporting nonzero RC executions to syslog | |
# * * * * * root /usr/local/bin/errcron.sh <command> | |
# Installation: wget -O /usr/local/bin/errcron.sh https://gist.githubusercontent.com/jangaraj/c4c9262fe04156a40b02/raw/580ab988f9ff28c01cc9ee729ac9f0fe175b3a80/errcron.sh | |
OUT=$("$@" 2>&1) | |
RESULT=$? | |
if [ $RESULT -ne 0 ] | |
then | |
logger "CRONERROR: $@ $OUT" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment