NavigationRecent Updates |
ifinputSubmitted by jm on Fri, 2007-07-06 16:12.System management | Unix
A wrapper command to run another command if there is any output on stdout ifinput crontab stdout stderr Stable Often Unix system administrators need an easy way to redirect any stderr output generated from crontab entries to a specific email address. With the ifinput binary, it's simple. For example: 20 8 * * * /usr/local/sbin/daily_stuff.sh 2>&1 | /usr/local/bin/ifinput mailx -s "Error: daily_stuff.sh" system-errors@foo.org Just arrange the crontab entries so that the periodic jobs don't generate stdout unless there's something interesting there. Then redirect stderr to stdout and pipe both to ifinput. ifinput can be used in a variety of different scenarios, not just cron jobs. Trackback URL for this post:http://lopsa.org/trackback/1477
add new comment | 940 reads
|