Adding System Notifications to Your Org Agenda

If you’re a Unix/Linux/MacOS user, chances are you have one or more cron jobs set up to handle routine maintenance chores. Cron jobs are an extraordinarily useful tool to make a lot of busy work disappear. Still, sometimes things go wrong and you’d like to know about it. That’s easy to do too. You can simply have your script output a notification of any anomalous conditions and cron will mail the notification to you.

The problem is that cron mails the notifications to your local machine mail account, which virtually nobody checks. You can, as Karl Voit used to do, set yourself a reminder to check it once a week or month or whatever time frame makes sense for you but that just leads to more busy work and problems may sit unnoticed between your scheduled checks.

Voit finally got tired of checking the machine mail account on each of his machines and set up a general mechanism to add cron job exception reports to his Org mode agenda. That turned out to be pretty easy to do. Voit doesn’t like programming in Elisp so he wrote some python scripts to append Org entries to his errors.org file. The cron job scripts call the python script to add errors and appropriate information to error.org which then gets displayed in his agenda. Follow the link to Voit’s post for the details including a few of the actual scripts he uses. It’s a very nice system and removes the need to periodically check for problems.

Of course, if you like Elisp, it would be easy to replace the Python with some Elisp, perhaps calling it from a script as Karlicoss showed us. In either case, take a look at Voit’s post. It’s full of good ideas for handling the routine but boring details of administering your own machine.

This entry was posted in General and tagged , . Bookmark the permalink.