Logrun

Copyright (C) 1999, Nick Andrew <nick@nick-andrew.net>

This program is distributed under the terms of the GNU General Public License (see http://www.gnu.org/licenses/gpl.html)

This script is designed to be used extensively within crontabs, to run a program which produces output, and save the output, but do not output anything to STDOUT unless the program fails (i.e. returns a non-zero exit code). If the program fails, the standard output and standard error are either sent to logrun's original STDOUT (i.e. to be captured by cron and emailed to the user) or emailed to an address which is specified by the MAILTO environment variable.

Installation

Just copy logrun and logrun-clean to any convenient directory and create a directory called ${HOME}/Logrun or /var/log/Logrun (for use by root).

Make sure that logrun-clean runs every so often to delete logfiles older than an age you specify.

Feedback and improvements

If you make any improvements to this script, please send them to me at <nick@nick-andrew.net>.

Download

logrun-1.0.tar.gz (3k)
The script plus this README file.