From owner-freebsd-questions@freebsd.org Thu Aug 27 13:25:42 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601129C4DA8 for ; Thu, 27 Aug 2015 13:25:42 +0000 (UTC) (envelope-from r100500b@gmail.com) Received: from mail-la0-x232.google.com (mail-la0-x232.google.com [IPv6:2a00:1450:4010:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C44F31BDC for ; Thu, 27 Aug 2015 13:25:41 +0000 (UTC) (envelope-from r100500b@gmail.com) Received: by laaa3 with SMTP id a3so3270186laa.2 for ; Thu, 27 Aug 2015 06:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=HU0YCyezCnVYZrUrl2ucFO3xCdpTzQRnqblr3m4u+t8=; b=i4+DBcx8n/sHONfCQ+/P/zGMvlGyiGRCXiKxfUJJLgv/8JUl7Xcv3F91A0FUaFjAOP Gi+hXWAjDNta1nySSxC5zcafUwuwBxWOnyHy6R9Q9uc5N5i4RzdqUaFIYty/0VWH0pWl rS3aTZex93UeC6HCzXrZQx9UyEihMPzKMHNNBzULsyTYsAymGIE55lAAnEWONyCOG0wK cNE4HTqW3JAf1LODd3/MDXbhBTeR/oEZXwMDWaOXMoPafqdmZt8R+A79g4km3esNL/pH qZdDz1APF8ydpzvtMG4tEoc78RQyw2k3t5vHQjodz8DKGKkluQz0VpppGxC0CKukCi4C ABcg== MIME-Version: 1.0 X-Received: by 10.152.7.37 with SMTP id g5mr2235981laa.101.1440681939891; Thu, 27 Aug 2015 06:25:39 -0700 (PDT) Received: by 10.112.55.9 with HTTP; Thu, 27 Aug 2015 06:25:39 -0700 (PDT) In-Reply-To: <55DF0DB3.3040400@qeng-ho.org> References: <55DF057F.6040205@gmail.com> <55DF0C75.5000907@qeng-ho.org> <55DF0DB3.3040400@qeng-ho.org> Date: Thu, 27 Aug 2015 16:25:39 +0300 Message-ID: Subject: Re: how to change daily cron emails to go to user account instead of root From: =?UTF-8?B?0KDRg9GB0LvQsNC9INCR0YPRgNGF0LDQvdC+0LI=?= To: Ernie Luzar Cc: freebsd-questions Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Aug 2015 13:25:42 -0000 man cront -m mailto Overrides the default recipient for cron mail. Each crontab(5= ) without MAILTO explicitly set will send mail to the mailto mail=E2=80=90 box. Sending mail will be disabled by default if mailto set to a null string, usually specified in a shell as '' or "". So you just can add this option on cron flags from rc.conf, like: cron_flags=3D"-m 'root@mymail.com'" and restart cron daemon. 2015-08-27 16:16 GMT+03:00 Arthur Chance : > On 27/08/2015 14:11, Arthur Chance wrote: > >> On 27/08/2015 13:41, Ernie Luzar wrote: >> >>> Hello list; >>> >>> How do I change the daily cron emails to go to user account instead of >>> root? I don't want any cron email going to root any more. >>> >>> man 5 crontab says the cron environment variable MAILTO =3D "account us= er >>> name" is way to change the cron email from the default of "root" to the >>> "account user name" you want. >>> >>> The part that is not clear is where do I place this MAILTO environment >>> variable? Do I edit /etc/crontab and pace it next to the PATH variable >>> or maybe in /etc/periodic.conf or /etc/csh.cshrc or /boot/loader.conf? >>> >> >> >> Only change MAILTO in the crontab if you wish *all* root's cron output >> to go to another user. >> > > Ack, misread because I was in the middle of dealing with periodic.conf. > Ignore the following. The setting goes at the top of the crontab, on a li= ne > by itself. > > > If you just want periodic output to go to a different place, you need to >> change the periodic.conf variables {daily,weekly,monthly}_output and >> {daily,weekly,monthly}_security_output. Probably the best way of doing >> that is to add the following to /etc/periodic.conf >> >> # set this next line to whatever mail address you want >> daily_output=3D"user@dom.ain" >> weekly_output=3D"$daily_output" >> monthly_output=3D"$daily_output" >> daily_security_output=3D"$daily_output" >> weekly_security_output=3D"$daily_output" >> monthly_security_output=3D"$daily_output" >> >> If you do it that way you only have to change one mail address in the >> future if you want to change the target address. >> >> > > -- > Those who do not learn from computing history are doomed to > GOTO 1 > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >