Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2003 09:47:56 +1030 (CST)
From:      Adam Smith <adam@internode.com.au>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/59693: df & du output values double when redirected from cron
Message-ID:  <200311252317.hAPNHuQA008372@gremlin.internode.com.au>
Resent-Message-ID: <200311252320.hAPNKFkP055779@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 25 15:20:15 PST 2003
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311252317.hAPNHuQA008372>