Using du.exe to calculate disk usage on a Microsoft cluster server
Larry Hall (Cygwin)
reply-to-list-only-lh@cygwin.com
Tue Jul 4 00:10:00 GMT 2006
Will Beldman wrote:
>> > In reply to:
> >> On 03 July 2006 14:50, Will Beldman wrote:
> >>
> >> I need to determine disk usage for each directory on a Microsoft
> cluster
> >> server. As a linux junkie, du is *the* tool for automating this kind of
> >> stuff so I installed cygwin, mapped some drives and tried to schedule
> >> the utility to run at night. However, I get a lot of errors thrown back
> >> such as:
> >> 1. "No such file or directory" - Which tends to appear on weird
> >> filenames (like with spaces or ' or some other character) or when I
> >> don't have permission to access the drive (but that's something I
> can fix)
>> >Without seeing your script and knowing the dir names in question, it's
> hard
> > to say, but the obvious bet would be some kind of shell
> quoting/escaping bug
> > in the way you invoke 'du'.
> Right, I was sure of this. But how would I make du properly escape? I'm
> trying to run the utility on S:/*. I don't have a defined list of
> directories to run against.
Use POSIX paths (i.e. /cygdrive/s). Here I think you've found an application
for 'find'. How about something like:
find /cygdrive/s -maxdepth 1 -print0 | xargs -0 du
--
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
216 Dalton Rd. (508) 893-9889 - FAX
Holliston, MA 01746
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list