From owner-freebsd-questions@FreeBSD.ORG Tue Feb 17 11:45:53 2004 Return-Path: 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 5FC8816A4CE for ; Tue, 17 Feb 2004 11:45:53 -0800 (PST) Received: from mail.indatacorp.com (65.104.0.66.ptr.us.xo.net [65.104.0.66]) by mx1.FreeBSD.org (Postfix) with SMTP id 1C8ED43D1F for ; Tue, 17 Feb 2004 11:45:53 -0800 (PST) (envelope-from rgrafton@indatacorp.com) Received: (qmail 40033 invoked by uid 0); 17 Feb 2004 19:47:35 -0000 Received: from unknown (HELO ITDept) (rgrafton@indatacorp.com@192.168.100.119) by netfb01.indatacorp.com with SMTP; 17 Feb 2004 19:47:35 -0000 From: "Randy Grafton" To: Date: Tue, 17 Feb 2004 12:54:10 -0700 Message-ID: <06c001c3f58f$cf273ed0$7764a8c0@ITDept> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Checking directory sizes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 19:45:53 -0000 I need to run a script that checks to see if a large directory has = finished copying onto my FreeBSD hosted Samba server. My script currently uses = 'du -s' to check the directory size. My problem is that the check can occur while the directory is still being copied, so the du commend takes a = long time before it returns a size. I'm guessing that the reason for this is = that du recursively checks subfolders and files then totals the size, but = when the directory in question is still growing from an external source the = du command is in catch-up mode and continues its recursion until it has outpaced the arrival of the new subdirectories/files. Is there any way = to see a quick snapshot of a file size, I hate to say this, but for example = on a Windows box you can start a folder/directory copy and if you click on = the new folder at any time during the copy you will see what Windows thinks = is the size at that time but by hitting refresh you will see the size = increase. Thanks -Randy