Rozdiely pre scripts/perl/filesystem/disk-usage.pl medzi verziami 1.2 a 1.3
| verzia 1.2, 2005/09/28 22:24:09 |
verzia 1.3, 2006/03/15 08:34:32 |
|
|
| # perl disk-usage.pl [/dev/hda1] [/dev/md3] |
# perl disk-usage.pl [/dev/hda1] [/dev/md3] |
| # |
# |
| |
|
| # $Platon: scripts/perl/filesystem/disk-usage.pl,v 1.1 2005/09/22 22:42:12 rajo Exp $ |
# $Platon: scripts/perl/filesystem/disk-usage.pl,v 1.2 2005/09/28 22:24:09 rajo Exp $ |
| |
|
| use strict; |
use strict; |
| use Data::Dumper; |
use Data::Dumper; |
| Riadok 35 while (my $line = <PASSWD>) { |
|
| Riadok 35 while (my $line = <PASSWD>) { |
|
| $qline = <QUOTA>; # skip 2 lines |
$qline = <QUOTA>; # skip 2 lines |
| while ($qline = <QUOTA>) { |
while ($qline = <QUOTA>) { |
| # TODO: bad info if grace |
# TODO: bad info if grace |
| my ($xx, $filesystem, $blocks, $b_quota, $b_limit, $files, $f_quota) = split(/\s+/, $qline); |
|
| |
chomp $qline; |
| |
# only a one word on the line. It is a long device name (LVM partition or something) |
| |
if (scalar(grep { $_ ne '' } split(/\s+/, $qline)) == 1) { |
| |
# grab 1 line |
| |
$qline .= <QUOTA>; |
| |
chomp $qline; |
| |
} |
| |
|
| |
my ($filesystem, $blocks, $b_quota, $b_limit, $files, $f_quota) = grep { $_ ne '' } split(/\s+/, $qline); |
| $user_stat->{$user}->{$filesystem}->{blocks} = $blocks; |
$user_stat->{$user}->{$filesystem}->{blocks} = $blocks; |
| $user_stat->{$user}->{$filesystem}->{files} = $files; |
$user_stat->{$user}->{$filesystem}->{files} = $files; |
| $glob_stat->{$filesystem}->{blocks} += $blocks; |
$glob_stat->{$filesystem}->{blocks} += $blocks; |
Platon Group <platon@platon.sk> http://platon.sk/
|
|