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

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

Revision 1.1, Fri Jun 3 09:28:47 2011 UTC (11 years, 2 months ago) by yason
Branch point for: MAIN

Initial revision

#!/usr/bin/perl
#
# $Id: wpquotas.pl,v 1.1 2011/06/03 09:28:47 yason Exp $
#
# User quotas ;-)
use wpqops;
use wpqio;
use wpqsmtp;

# @VOLUMES hardcoded, be careful!
my @VOLUMES = ("/V1/*/manager", "/V2/*/manager", "/V3/*/manager", "/V4/*/manager", "/V5/*/manager");
my @blacklisted;
my $line;
my $user;
my $amount;
my $v;
my $blacklisted_ref;
my @report;
my $report_i = 0;


foreach $v (@VOLUMES)
{
    $blacklisted_ref = wpqops::do_walk($v);
    @blacklisted = @$blacklisted_ref;
    
    foreach $line (@blacklisted) 
    {
	($user, $amount) = split( / /, $line);
	wpqsmtp::email($user, $amount);
	$report[$report_i] = $line;
	$report_i++;
    }
}

wpqsmtp::email_cio(\@report);