My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Wednesday, March 18, 2009

Using cronic to reduce "cram" (cron spam)

I'm working on reducing the about of email I'm getting from my cron jobs. One thing I stumbled across is cronic. I used it as following to quiet my cron jobs.

First, to install it:
# wget -O /usr/local/bin/cronic
# chmod 755 /usr/local/bin/cronic
Now to use it, edit your cron scripts to use cronic as a wrapper. Before:
# cat /etc/cron.daily/backup-web-server
/usr/local/bin/ /etc/backup-web-server.conf
And after:
# vi /etc/cron.daily/backup-webserver
# cat /etc/cron.daily/backup-web-server
/usr/local/bin/cronic /usr/local/bin/ /etc/backup-web-server.conf
That's it. Now unless your cron job either has output to stderr or returns non-zero, it will produce no output.
Post a Comment