From owner-freebsd-questions@FreeBSD.ORG Thu Jan 19 14:19:29 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 52B9116A41F for ; Thu, 19 Jan 2006 14:19:29 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail4.sea5.speakeasy.net (mail4.sea5.speakeasy.net [69.17.117.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F24F43D58 for ; Thu, 19 Jan 2006 14:19:27 +0000 (GMT) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 31676 invoked from network); 19 Jan 2006 14:19:27 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 19 Jan 2006 14:19:27 -0000 Received: by be-well.ilk.org (Postfix, from userid 1147) id 85CF028423; Thu, 19 Jan 2006 09:19:26 -0500 (EST) Sender: lowell@be-well.ilk.org To: bsd References: <6F61FBCF-8AC8-4EEF-935F-BEF1EF0E56CF@todoo.biz> From: Lowell Gilbert Date: 19 Jan 2006 09:19:26 -0500 In-Reply-To: <6F61FBCF-8AC8-4EEF-935F-BEF1EF0E56CF@todoo.biz> Message-ID: <44fynkqp01.fsf@be-well.ilk.org> Lines: 43 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Liste FreeBSD Subject: Re: Cron script redirection (probably stderr problem ?) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2006 14:19:29 -0000 bsd writes: > Hello, > > I am using a little cron script to update my server that calls > "portsnap". Once this is done there is another piece of script that > tells me which port(s) is to be updated with a simple call to a > script that mainly execute portversion -l "<" and mail me the output > of the command. > > > There is one little problem with that script : > > Cron mails me (root) each time this output (probably because it comes > from standerr ?) : > > > [Updating the portsdb in /usr/ports ... - 14011 > > port entries found > > ......... 1000.........2000.........3000.........4000.........5000.........6000. ........ 7000.........8000.........9000.........10000.........11000.........120 > > 00.........13000.........14000 ..... done] > > > The cron script is executed as follow : > > 0 3 * * * /usr/local/sbin/portsnap cron && /usr/local/sbin/portsnap - > I update && /root/src/upgrade.sh > /var/log/upgrade.log > > > I've tried to add a 2>&1 at the end of the script : > > 0 3 * * * /usr/local/sbin/portsnap cron && /usr/local/sbin/portsnap - > I update && /root/src/upgrade.sh > /var/log/upgrade.log 2>&1 > > > But this does not seem to change my problem. That should work, assuming the output comes from the stderr of /root/src/upgrade.sh. I even tested the syntax to make sure I wasn't just confused by my lack of coffee this morning... -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/