--- /usr/sbin/run-crons.old 2013-11-17 20:42:57.012748448 +0100 +++ /usr/sbin/run-crons.old 2013-11-17 20:45:58.389054832 +0100 @@ -30,6 +30,8 @@ # for scripts to be executed. The info about last run is stored in # /var/spool/cron/lastrun +HAS_ERRORS=0 + LOCKDIR=/var/spool/cron/lastrun LOCKFILE=${LOCKDIR}/lock @@ -100,6 +102,7 @@ if [[ -x $SCRIPT && ! -d $SCRIPT ]]; then [ -x /usr/bin/logger ] && /usr/bin/logger -i -p cron.info -t run-crons "(`whoami`) CMD ($SCRIPT)" $SCRIPT + [ $? -ne 0 ] && HAS_ERRORS=1 fi done fi @@ -108,3 +111,5 @@ # Clean out bogus cron.$BASE files with future times touch ${LOCKDIR} find ${LOCKDIR} -newer ${LOCKDIR} -exec /bin/rm -f {} \; &>/dev/null || true + +exit ${HAS_ERRORS}