[BACK]Return to wpqops.pm CVS log [TXT][DIR] Up to [local] / wpscripts / wpquotas

File: [local] / wpscripts / wpquotas / wpqops.pm (download)

Revision 1.1.1.1 (vendor branch), Fri Jun 3 09:28:47 2011 UTC (12 years, 9 months ago) by yason
Branch: yason, MAIN
CVS Tags: import, HEAD
Changes since 1.1: +0 -0 lines

import scripts for fullprint

package wpqops;

use wpqio;

my $DU = "/usr/bin/du -md 0 ";
my $MLIMIT = 15360;  # in MBytes


sub wpqops::do_walk($)
{
    my $v = shift;
    my @tmp;
    my $userdir;
    my $username;
    my $amount;
    my $line;
    my $i;
    my @blacklisted;
    
    @tmp = (`$DU$v`);
    
    foreach $line (@tmp)
    {
	chomp($line);
	($amount, $userdir) = split( /\t/, $line, 2);
	
	#
	# This is bad, but it's better than nothing ;-)
	# as usual..
	$user = substr($userdir, 4);
	$user = substr($user, 0, -8);
	
	if($amount > $MLIMIT)
	{
	    wpqio::print("$user has exceeded his limit ($amount)\n");
	    
	    $blacklisted[@blacklisted] = "$user $amount";
	}
    }

    return \@blacklisted;
}

return 1;