From adam@gremlin.internode.com.au  Tue Nov 25 15:17:47 2003
Return-Path: <adam@gremlin.internode.com.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7E9AD16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Nov 2003 15:17:47 -0800 (PST)
Received: from gremlin.internode.com.au (gremlin.internode.com.au [192.83.231.88])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3726643F93
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 25 Nov 2003 15:17:46 -0800 (PST)
	(envelope-from adam@gremlin.internode.com.au)
Received: from gremlin.internode.com.au (localhost [127.0.0.1])
	by gremlin.internode.com.au (8.12.9/8.12.9) with ESMTP id hAPNHuJ0008373
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 26 Nov 2003 09:47:56 +1030 (CST)
	(envelope-from adam@gremlin.internode.com.au)
Received: (from adam@localhost)
	by gremlin.internode.com.au (8.12.9/8.12.9/Submit) id hAPNHuQA008372;
	Wed, 26 Nov 2003 09:47:56 +1030 (CST)
Message-Id: <200311252317.hAPNHuQA008372@gremlin.internode.com.au>
Date: Wed, 26 Nov 2003 09:47:56 +1030 (CST)
From: Adam Smith <adam@internode.com.au>
Reply-To: Adam Smith <adam@internode.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: df & du output values double when redirected from cron
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         59693
>Category:       bin
>Synopsis:       df & du output values double when redirected from cron
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 25 15:20:15 PST 2003
>Closed-Date:    Tue Nov 25 16:02:09 PST 2003
>Last-Modified:  Tue Nov 25 16:02:09 PST 2003
>Originator:     Adam Smith
>Release:        FreeBSD 5.1-RELEASE i386
>Organization:
Internode
>Environment:
System: FreeBSD gremlin 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Tue Oct 7 13:44:38 CST 2003 adam@panther:/usr/obj/usr/src/sys/PANTHER i386


	
>Description:

When using df or du in a scripted cron job, for any redirected output to a 
text file, the usage integer values are doubled.

>How-To-Repeat:

Create the following script and add it to cron as root or a regular user:

	$ crontab -l
	*/1 * * * * /home/adam/test.sh > /home/adam/output.txt

	$ cat test.sh 
	#!/bin/sh
	df

Now let's look at the output:

	$ df | grep ad0s2f
	/dev/ad0s2f                                        49028074 26711856 18393974    59%    /usr

	$ cat output.txt 
	/dev/ad0s2f                                        98056148 53423708 36787952    59%    /usr

Both du and df produced the same results, while ls worked properly,
and other programs with "digit" values such as iostat worked fine aswell.


>Fix:

No fix known.


>Release-Note:
>Audit-Trail:

From: Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To: Adam Smith <adam@internode.com.au>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/59693: df & du output values double when redirected from cron
Date: Wed, 26 Nov 2003 00:37:31 +0100

 On Wed, Nov 26, 2003 at 09:47:56AM +1030, Adam Smith wrote:
 
 > Now let's look at the output:
 > 
 > 	$ df | grep ad0s2f
 > 	/dev/ad0s2f                                        49028074 26711856 18393974    59%    /usr
 > 
 > 	$ cat output.txt 
 > 	/dev/ad0s2f                                        98056148 53423708 36787952    59%    /usr
 > 
 > Both du and df produced the same results, while ls worked properly,
 > and other programs with "digit" values such as iostat worked fine aswell.
 
 How about BLOCKSIZE in Yours and crons environment?
 
 
 -- 
 Pawe Maachowski
State-Changed-From-To: open->closed 
State-Changed-By: simon 
State-Changed-When: Tue Nov 25 16:00:50 PST 2003 
State-Changed-Why:  
Submitter has confirmed that this was not a bug, but caused 
by different values of the BLOCKSIZE environment variable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=59693 
>Unformatted:
