in reply to Who bloated my server?

use File::Finder; my %sizes; my @START = "."; $sizes{$_->[0]} += $_->[1] for File::Finder->type('f')->mtime('-3')->collect(sub { [(stat)[4, 7]] } +, @START); for (sort { $sizes{$b} <=> $sizes{$a} } keys %sizes) { printf "%20s %.2f MB\n", getpwuid($_) || "($_)", $sizes{$_}/1e6; }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^2: Who bloated my server?
by neniro (Priest) on Jul 21, 2004 at 16:19 UTC
    Thank you, merlyn. Your File::Finder is a nice alternative to File::Find::Rule and new to me. I prefer the way you handle the mtime, in a more unix/find-like way.

    neniro

      Yeah, File::Find::Rule is especially OK if you don't really grok traditional Unix find. But I find (heh) that my years of practice with find made me always look sideways at how to do the same things with FFR, so I wrote File::Finder instead. And, you get the best of both worlds because FF can accept FFR steps too.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.