Annotation of wpscripts/wpquotas/wpqops.pm, Revision 1.1
1.1 ! yason 1: package wpqops;
! 2:
! 3: use wpqio;
! 4:
! 5: my $DU = "/usr/bin/du -md 0 ";
! 6: my $MLIMIT = 15360; # in MBytes
! 7:
! 8:
! 9: sub wpqops::do_walk($)
! 10: {
! 11: my $v = shift;
! 12: my @tmp;
! 13: my $userdir;
! 14: my $username;
! 15: my $amount;
! 16: my $line;
! 17: my $i;
! 18: my @blacklisted;
! 19:
! 20: @tmp = (`$DU$v`);
! 21:
! 22: foreach $line (@tmp)
! 23: {
! 24: chomp($line);
! 25: ($amount, $userdir) = split( /\t/, $line, 2);
! 26:
! 27: #
! 28: # This is bad, but it's better than nothing ;-)
! 29: # as usual..
! 30: $user = substr($userdir, 4);
! 31: $user = substr($user, 0, -8);
! 32:
! 33: if($amount > $MLIMIT)
! 34: {
! 35: wpqio::print("$user has exceeded his limit ($amount)\n");
! 36:
! 37: $blacklisted[@blacklisted] = "$user $amount";
! 38: }
! 39: }
! 40:
! 41: return \@blacklisted;
! 42: }
! 43:
! 44: return 1;
CVSweb