From f6724e0ba96a17743c1ab14b97248c62949342d8 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 26 May 2011 11:21:33 +0200 Subject: [PATCH] cronify --- cronify/cronify | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 cronify/cronify diff --git a/cronify/cronify b/cronify/cronify new file mode 100755 index 0000000..1e3f9e3 --- /dev/null +++ b/cronify/cronify @@ -0,0 +1,19 @@ +#!/bin/bash +# cronify, +# script to properly wrap things called from cron +# silent on non-error, outputs only on failure +# +# 2011 jeffrey paul +# 5539 AD00 DE4C 42F3 AFE1 1575 0524 43F4 DF2A 55C2 + +if [ $# -eq 0 ]; then + echo "usage: $0 " > /dev/stderr + exit 1 +fi + +OUTPUT="`$* 2>&1`" + +if [ $? -ne 0 ]; then + echo $OUTPUT > /dev/stderr + exit $? +fi