Cron: Difference between revisions
From wiki
Created page with "== Setup Notifications == By default email sent from cron will go to <code><username>@<hostname></code> which is a bit of a pain to setup mail filters when you get multiple ma..." |
(No difference)
|
Revision as of 09:07, 2 April 2016
Setup Notifications
By default email sent from cron will go to <username>@<hostname> which is a bit of a pain to setup mail filters when you get multiple machines and multiple usernames.
The solution is to add near the top of the /etc/crontab
MAILTO=logs-cron-myserver@example.com
This apply to all crontab entries bellow this line. Which mean that you can get per entry email by having multiple MAILTO lines.
Note: You need to add this line in all crontab files. This mean /etc/anacrontab if it exist as well as users crontab.