Date: Thu, 27 Aug 2015 14:09:29 +0100 From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-questions@freebsd.org Subject: Re: how to change daily cron emails to go to user account instead of root Message-ID: <55DF0C09.9000403@FreeBSD.org> 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
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55DF0C09.9000403>