From owner-freebsd-questions@freebsd.org Thu Aug 27 13:09: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 B706E9C4624 for ; Thu, 27 Aug 2015 13:09:42 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46E63AED for ; Thu, 27 Aug 2015 13:09:42 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from zero-gravitas.local (no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged)) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.15.2/8.15.2) with ESMTPSA id t7RD9ZKU084519 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 27 Aug 2015 14:09:36 +0100 (BST) (envelope-from matthew@FreeBSD.org) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org DKIM-Filter: OpenDKIM Filter v2.10.3 smtp.infracaninophile.co.uk t7RD9ZKU084519 Authentication-Results: smtp.infracaninophile.co.uk/t7RD9ZKU084519; dkim=none; dkim-atps=neutral X-Authentication-Warning: lucid-nonsense.infracaninophile.co.uk: Host no-reverse-dns.metronet-uk.com [85.199.232.226] (may be forged) claimed to be zero-gravitas.local Subject: Re: how to change daily cron emails to go to user account instead of root To: freebsd-questions@freebsd.org References: <55DF057F.6040205@gmail.com> <55DF082D.8040001@mezonplus.ru> From: Matthew Seaman X-Enigmail-Draft-Status: N1110 Message-ID: <55DF0C09.9000403@FreeBSD.org> Date: Thu, 27 Aug 2015 14:09:29 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <55DF082D.8040001@mezonplus.ru> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qisTgca63mDOTfNQN9D4PW3J32rDJVwTP" X-Virus-Scanned: clamav-milter 0.98.7 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on lucid-nonsense.infracaninophile.co.uk 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:09:42 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qisTgca63mDOTfNQN9D4PW3J32rDJVwTP Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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? >=20 > Have you seen the EXAMPLE CRON FILE section of the man 5 crontab? >=20 > EXAMPLE CRON FILE > # use /bin/sh to run commands, overriding the default set by cron > SHELL=3D/bin/sh > # mail any output to `paul', no matter whose crontab this is > MAILTO=3Dpaul > # > # 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 --qisTgca63mDOTfNQN9D4PW3J32rDJVwTP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQJ8BAEBCgBmBQJV3wwPXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTnZKYP/2sNRwLmuKevm9KAcZ/KD2sZ i9LAHAQ+LEGuGkkvRvH5hsydO823fl8B/H0tUWl8/Qho1FEvvgI3PUbzX7ZFopEz 6d9VhStk0bZBIxS05/ab3gWvBxm4OncWga+yPZb1ZjCKAoyxJOdp2VnL/9p0JkOp in1XxuFNaBg5KR1Oss7xBhBxxFKqiWoK0n1btkfnZKoDCKOrg4m4FcDwxynVMpE9 +y/qSnUxs2bg3SYRY6b1MOAgYS+xSfcYJRYANTSZIPlH32eFaEt/NiW/kfzvi/6G Lm6g/CXckBDjeZxvhCx5jkp8sEVdi3RYG0vNeOH/UnffIC0xSPa/hIu6R1wghPl/ EvNTMkYLUEQ78xU9nkJdSANhH5hMEv6qEx0hAnivMyFveq8UkBz6XGTvJ2IzF5g/ A/mHV8w8781v5UCwmk+HsK8XWt46VkrX6VKQ4/ALZzECeLk/9YaeeC6pjwoakVCU 9VZMnNlwdkslSOiclQ3A500HkMvydocZmFjAr7I0mKLgAg3HxTuOGEJUYjAqmHC1 0aN8kUODH75rYecpb7mLir8LxcXBOZdXiYqJHDY5o2rt+2HM4BxRC9nN9R5ZJoqo 1p51GSq4DJuvNtFllPsMWNrzIeYuat+J1dFmXPMc6B5XpTtV6lVCDNlRu1gAMLDN OQLKXKq67qxb7Y8YeODt =eIvA -----END PGP SIGNATURE----- --qisTgca63mDOTfNQN9D4PW3J32rDJVwTP--