bin/59693: df & du output values double when redirected from cron
Adam Smith
adam at internode.com.au
Tue Nov 25 15:20:17 PST 2003
>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 at 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:
More information about the freebsd-bugs
mailing list