how to change daily cron emails to go to user account instead of root

Shane Ambler FreeBSD at ShaneWare.Biz
Fri Aug 28 06:22:46 UTC 2015


On 27/08/2015 22:23, Alexander Moisseev wrote:
> On 27.08.2015 15:41, Ernie Luzar wrote:
>> The part that is not clear is where do I place this MAILTO environment
>> variable?
>
> Have you seen the EXAMPLE CRON FILE section of the man 5 crontab?
>
> EXAMPLE CRON FILE
>       # use /bin/sh to run commands, overriding the default set by cron
>       SHELL=/bin/sh
>       # mail any output to `paul', no matter whose crontab this is
>       MAILTO=paul
>       #
>       # run five minutes after midnight, every day
>       5 0 * * *       $HOME/bin/daily.job >> $HOME/tmp/out 2>&1

Another option is to use the .forward file.

echo "\paul" >> /root/.forward

see man forward


-- 
FreeBSD - the place to B...Software Developing

Shane Ambler



More information about the freebsd-questions mailing list