From owner-freebsd-questions@FreeBSD.ORG Wed Nov 26 09:58:02 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D7B216A4CE for ; Wed, 26 Nov 2003 09:58:02 -0800 (PST) Received: from makeworld.com (makeworld.com [12.15.124.245]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BFB843FEA for ; Wed, 26 Nov 2003 09:58:01 -0800 (PST) (envelope-from racerx@makeworld.com) Received: from makeworld.com (unknown [12.15.124.131]) by makeworld.com (Postfix) with ESMTP id CA6215A; Wed, 26 Nov 2003 11:58:36 -0600 (CST) Message-ID: <3FC4E92A.2030602@makeworld.com> Date: Wed, 26 Nov 2003 11:55:54 -0600 From: Chris User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Kevin D. Kinsey, DaleCo, S.P." References: <3FC4D7D4.11526.C30C22@localhost> <3FC4E747.2000503@daleco.biz> In-Reply-To: <3FC4E747.2000503@daleco.biz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: stuart.gibson@bridgeman.co.uk cc: freebsd-questions@freebsd.org Subject: Re: crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2003 17:58:02 -0000 Kevin D. Kinsey, DaleCo, S.P. wrote: > stuart.gibson@bridgeman.co.uk wrote: > >> Hi, >> >> I have a number of scripts that run every night using a crontab. In >> my crontab file I'm using the MAILTO flag to get cron to email me >> every time it runs which results in a lot of emails. >> >> Is there any way of instructing cron to only email me if the cron job >> fails? >> >> regards >> >> Stuart Gibson >> >> >> > > Sure! > > > Redirect stderror to /dev/null: > > /bin/sh /home/me/myscript > /dev/null > > And this one won't mail you, whether it errors > or not.... > > /bin/sh /home/me/myscript > /dev/null 2>&1 > > > Kevin Kinsey > DaleCo, S.P. Very cool! Now, what if you do the same, but instead of the normal crons, can something like this be done with the /etc/periodic/daily, weekly, and monthly routines? -- Best regards, Chris ______________________________________________________________________ PGP Fingerprint = D976 2575 D0B4 E4B0 45CC AA09 0F93 FF80 C01B C363 PGP Mail encouraged / preferred - keys available on common key servers ______________________________________________________________________ 01010010011000010110001101100101011100100101100000000000