From owner-freebsd-fs@FreeBSD.ORG Fri Feb 9 22:06:41 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5C4716A402 for ; Fri, 9 Feb 2007 22:06:41 +0000 (UTC) (envelope-from mwm-dated-1171921255.ffef4d@mired.org) Received: from mired.org (vpn.mired.org [66.92.153.74]) by mx1.freebsd.org (Postfix) with SMTP id 6220613C46B for ; Fri, 9 Feb 2007 22:06:41 +0000 (UTC) (envelope-from mwm-dated-1171921255.ffef4d@mired.org) Received: (qmail 10544 invoked by uid 1001); 9 Feb 2007 21:40:55 -0000 Received: by bhuda.mired.org (tmda-sendmail, from uid 1001); Fri, 09 Feb 2007 16:40:55 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17868.60007.226858.275351@bhuda.mired.org> Date: Fri, 9 Feb 2007 16:40:55 -0500 To: "Victor Loureiro Lima" In-Reply-To: References: X-Mailer: VM 7.17 under 21.4 (patch 20) "Double Solitaire" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Mike Meyer Cc: freebsd-fs@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: /usr/bin/du + crontab weird bug X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Feb 2007 22:06:41 -0000 In , Victor Loureiro Lima typed: > Hello -hackers and -fs, > > Sorry for the cross-post but I didnt know where this particular post > belonged to... > In a .br FreeBSD related mailing-list a user seems to have a found a > bug when using /usr/bin/du and crontab together, I am posting it here > to see what responses we get: > > root@zion# du -s /etc > 2544 /etc > root@zion# cat /etc/crontab | grep du > 30 19 * * 5 root /usr/bin/du -s /etc >> /tmp/lele > root@zion# date > Fri Feb 9 19:29:30 BRST 2007 > root@zion# cat /tmp/lele > 5088 /etc > root@zion# du -s /etc > 2544 /etc > > What gives that when "/usr/bin/du -s" is running from crontab is gives > the exact double of entries in the directory but when it is running > from console itself, it doesnt display the same amount of > entries!?!?!?! du uses the BLOCKSIZE environment variable to decide what size blocks to display. Crontab commands don't run with your environment; they run with a very restricted one. This is documented in the du manual page. > Weird bug... Someone probably set BLOCKSIZE in your environment. Try using "du -sk" to force du to use 1k blocks. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.