summaryrefslogtreecommitdiff
path: root/cron/regen_quota.pl
blob: e582b301269e56df8f25ddc8b3259b6005801260 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
use strict;
use Cwd 'abs_path';
use File::Basename;
use local::db;
use config;

for my $owner (local::db::owner->retrieve_all)
{
  my $sum =0;
	for my $dl ($owner->download)
	{
    $sum+=$dl->size
	}
	$owner->quota_used($sum);
	$owner->update
}