From owner-freebsd-questions@FreeBSD.ORG Wed Nov 26 09:53:13 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 DD42716A4CE for ; Wed, 26 Nov 2003 09:53:13 -0800 (PST) Received: from mxsf30.cluster1.charter.net (mxsf30.cluster1.charter.net [209.225.28.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AFB643FE3 for ; Wed, 26 Nov 2003 09:53:08 -0800 (PST) (envelope-from chowse@charter.net) Received: from moe.howse.homeunix.net (jackson-66-168-145-25.midtn.chartertn.net [66.168.145.25]) hAQHmLBH088577; Wed, 26 Nov 2003 12:48:31 -0500 (EST) (envelope-from chowse@charter.net) From: Charles Howse To: stuart.gibson@bridgeman.co.uk, freebsd-questions@freebsd.org Date: Wed, 26 Nov 2003 11:48:17 -0600 User-Agent: KMail/1.5.4 References: <3FC4D7D4.11526.C30C22@localhost> In-Reply-To: <3FC4D7D4.11526.C30C22@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311261148.17839.chowse@charter.net> 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:53:14 -0000 X-List-Received-Date: Wed, 26 Nov 2003 17:53:14 -0000 X-List-Received-Date: Wed, 26 Nov 2003 17:53:14 -0000 On Wednesday 26 November 2003 10:41 am, 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? By default, cron will email you whatever would be shown on the terminal when the script runs. The way I get around this is to redirect the stdout of the script to /dev/ null. Like this: 0 0 * * * /root/bin/myscript.sh > /dev/null -- Thanks, Charles http://howse.homeunix.net:8080 Random Murphy's Law: All general statements are false. (Think about it.)