]> andersk Git - moira.git/blame - incremental/afs_quota.pl
New database and column names for Moira2.
[moira.git] / incremental / afs_quota.pl
CommitLineData
6231b320 1#!/afs/athena/contrib/perl/perl
2# Usage: afs_quota path quota
3
4require "/moira/bin/afs_utils.pl";
5
6die "Usage: $0 path quota\n" unless (@ARGV==2);
7
8($path,$newq) = @ARGV;
9$path =~ s:^/afs/([^.]):/afs/.\1:;
10
11system("$fs checkb >/dev/null");
12
13open(PROG,"$fs lv $path|");
14chop(@fs=<PROG>);
15close(PROG);
16die "Unable to get information about $path\n" if ($?);
17
18@tmp = split(/\s+/, shift(@fs));
19$vname = pop(@tmp);
20@tmp = split(/\s+/, shift(@fs));
21$oldq = pop(@tmp);
22
23open(PROG,"$fs whichcell $path|");
24chop($_=<PROG>);
25close(PROG);
26die "Unable to get information about $path\n" if ($?);
27
28@tmp=split(/\s+/,$_);
29($cell=pop(@tmp)) =~ s/^'(.*)'$/\1/;
30$cell =~ tr/a-z/A-Z/;
31
32open(PROG,"$vos ex $vname -cell $cell|");
33chop(@tmp=<PROG>);
34close(PROG);
35die "Unable to get volume information about $vname ($path)\n" if ($?);
36
37shift(@tmp), $_ = shift(@tmp);
38($asrv,$asrv,$apart) = split(/\s+/,$_);
39
40system("$fs","sq",$path,$newq);
41die "Unable to change quota on $path\n" if ($?);
6231b320 42&afs_quota_adj($cell,$asrv,$apart,$newq-$oldq);
119f209e 43
44#$stat_fs = $?;
45#$stat_qa = &afs_quota_adj($cell,$asrv,$apart,($stat_fs ? 0 : $newq-$oldq));
46#die "Unable to change quota on $path\n" if ($stat_fs && $stat_qa);
47#warn "Unable to change quota on $path\n" if ($stat_fs);
This page took 0.05279 seconds and 5 git commands to generate.