]>
Commit | Line | Data |
---|---|---|
6231b320 | 1 | #!/afs/athena/contrib/perl/perl |
2 | # Usage: afs_quota path quota | |
3 | ||
4 | require "/moira/bin/afs_utils.pl"; | |
5 | ||
6 | die "Usage: $0 path quota\n" unless (@ARGV==2); | |
7 | ||
8 | ($path,$newq) = @ARGV; | |
9 | $path =~ s:^/afs/([^.]):/afs/.\1:; | |
10 | ||
11 | system("$fs checkb >/dev/null"); | |
12 | ||
13 | open(PROG,"$fs lv $path|"); | |
14 | chop(@fs=<PROG>); | |
15 | close(PROG); | |
16 | die "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 | ||
23 | open(PROG,"$fs whichcell $path|"); | |
24 | chop($_=<PROG>); | |
25 | close(PROG); | |
26 | die "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 | ||
32 | open(PROG,"$vos ex $vname -cell $cell|"); | |
33 | chop(@tmp=<PROG>); | |
34 | close(PROG); | |
35 | die "Unable to get volume information about $vname ($path)\n" if ($?); | |
36 | ||
37 | shift(@tmp), $_ = shift(@tmp); | |
38 | ($asrv,$asrv,$apart) = split(/\s+/,$_); | |
39 | ||
40 | system("$fs","sq",$path,$newq); | |
41 | die "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); |