Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2004 12:54:10 -0700
From:      "Randy Grafton" <rgrafton@indatacorp.com>
To:        <freebsd-questions@freebsd.org>
Subject:   Checking directory sizes
Message-ID:  <06c001c3f58f$cf273ed0$7764a8c0@ITDept>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?06c001c3f58f$cf273ed0$7764a8c0>