how to change daily cron emails to go to user account instead of root
Matthew Seaman
matthew at FreeBSD.org
Thu Aug 27 13:09:42 UTC 2015
On 2015/08/27 13:53, 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
That's how in general, you control where cron sends the stdout or stderr
from any commands it runs. However, it doesn't answer the OP's specific
question about periodic scripts -- those handle e-mailing their results
out themselves, which is controlled by setting the
{daily,weekly,monthly}_output variable in periodic.conf
Cheers,
Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 972 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20150827/ba16f7b5/attachment.bin>
More information about the freebsd-questions
mailing list