Email alerts from cron jobs - jneubert/doc GitHub Wiki
Email alerts from cron jobs
Normally (Centos 7), /etc/crontab contains an entry:
MAILTO=root
Furthermore, we assume that the mail utitity has been installed (yum package mailx).
For email alerts to work, we need a local email setup and a forwarding rule from root@localhost to the target address.
If a mail agent (e.g. postfix) is up and running, we can define an alias in /etc/aliases
root: [email protected]
and compile aliases.db via the newaliases command.
Then we can check our setup with
mail -s "Test alert" root < /dev/null