Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Aug 2015 15:52:42 +0930
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        Alexander Moisseev <moiseev@mezonplus.ru>, freebsd-questions@freebsd.org
Subject:   Re: how to change daily cron emails to go to user account instead of root
Message-ID:  <55DFFE32.3020508@ShaneWare.Biz>
In-Reply-To: <55DF082D.8040001@mezonplus.ru>
References:  <55DF057F.6040205@gmail.com> <55DF082D.8040001@mezonplus.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55DFFE32.3020508>