From owner-freebsd-questions@freebsd.org Thu Aug 27 13:30:10 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 5EA099C207C for ; Thu, 27 Aug 2015 13:30:10 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "fileserver.home.qeng-ho.org", Issuer "fileserver.home.qeng-ho.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E14396C1 for ; Thu, 27 Aug 2015 13:30:09 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.15.2/8.15.2) with ESMTP id t7RDBHkJ010423; Thu, 27 Aug 2015 14:11:17 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Subject: Re: how to change daily cron emails to go to user account instead of root To: Ernie Luzar , freebsd-questions@freebsd.org References: <55DF057F.6040205@gmail.com> From: Arthur Chance Message-ID: <55DF0C75.5000907@qeng-ho.org> Date: Thu, 27 Aug 2015 14:11:17 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DF057F.6040205@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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:30:10 -0000 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 = "account user > 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. 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="user@dom.ain" weekly_output="$daily_output" monthly_output="$daily_output" daily_security_output="$daily_output" weekly_security_output="$daily_output" monthly_security_output="$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