I'd like to get the output of our crons to be emailed to me, as we've been having some issues recently which would have been much easier to resolve if they'd been emailed.
I've googled it and it suggested adding: | mail -s "subject" firstname.lastname@example.org
So what I've got now is:
*/5 * * * * /usr/bin/php/ /root/to/file/test.php | mail -s "test output" email@example.com
However it's not sending anything.
I've been into the cron log and it's outputting this:
May 14 11:10:01 moodledev crond: (root) CMD (/usr/bin/php /root/to/file/test.php | mail -s "test output" firstname.lastname@example.org^M)
The only thing that looks wrong to me is the ^M at the end, which i'm not sure where it has appeared from.
Any clues on where i'm going wrong?