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
qshape 2>&1 | mail -s "Queue Summary" -Ewhich sends an email only if it's non-zero length. (mail -E) Also see http://unix.stackexchange.com/questions/13326/how-to-pipe-output-from-one-process-to-another-but-only-execute-if-the-first-has – razzed Jan 01 '17 at 22:19Queue Summary; PATH=/usr/sbin qshape– Akom Dec 11 '18 at 15:18Quere Summaryto shorten the subject line. I have tried\u0003, that is,=?UTF-8?Q?=03?=, but that is shown as a space in the email header when received. Any other ideas? – bers Apr 07 '20 at 16:28