How to Modify a Cronjob Email Subject

Posted by justinl on Server Fault See other posts from Server Fault or by justinl
Published on 2009-08-20T06:58:44Z Indexed on 2013/06/27 10:23 UTC
Read the original article Hit count: 403

Filed under:
|

I am running a half dozen different cron jobs from my hosting at Hostmonster.com. When a cronjob has been executed I receive an email with the output of the script.

The email comes in the format of:

From: Cron Daemon
Subject: Cron  /ramdisk/bin/php5 -c /home5/username/scheduled/optimize_mysql.bash

The problem with this is that the subject of the email makes it very hard to read which cronjob the email is pertaining to.

Is there a way to modify the subject of a cronjob email so that it's easier to read?

For example:

From: Cron Daemon
Subject: Optimize MySQL Database

© Server Fault or respective owner

Related posts about email

Related posts about cron