]> andersk Git - moira.git/blobdiff - incremental/afs_utils.pl
Now rcp'ing with encryption, and actually checking that backup succeeded.
[moira.git] / incremental / afs_utils.pl
index ba1f8a14e949d39fc91843dcfa51ad75c12e81a8..06cbecb0fcac06f28a0cb95c26928ee41fe1492a 100644 (file)
@@ -1,7 +1,10 @@
+# $Header$
+
 $afsbin="/moira/bin";
 $vos="$afsbin/vos";
 $pts="$afsbin/pts";
 $fs="$afsbin/fs";
+$zwrite="/usr/athena/bin/zwrite";
 
 $afs_data="/moira/afs/afs_data";
 $afs_save="$afs_data.tmp";
@@ -16,6 +19,8 @@ $LOCK_UN=8;
      "CONTRIB", "contrib",
      "COURSE", "course",
      "HOMEDIR", "user",
+     "LEASE", "dept",
+     "ORG", "org",
      "PROJECT", "project",
      "REF", "ref",
      "SW", "sw",
@@ -63,14 +68,14 @@ sub afs_unlock
 #    max[ (2*free space) - (unused quota) ]
 #    = max(2*total - usage - alloc)
 #
-# Note: This routine does not actually adjust the quota; the caller
-# should use afs_quota_adj();
+# Note: This routine does not actually adjust the quota;
+# the calling routine should use afs_quota_adj();
 
 sub afs_find
 {
     local($cell,$type,$quota,@except) = @_;
     local($j,$k);
-    local(@max) = '';
+    local(@max) = ("", "", -10000000);
 
     &afs_lock;
     chop(@afs_data);
@@ -96,7 +101,7 @@ sub afs_find
 #
 sub afs_quota_adj
 {
-    local($cell,$asrv,$apart,$adj) = @_;
+    local($cell,$asrv,$apart,$adj,$dusage) = @_;
     local($found) = 0;
 
     &afs_lock;
@@ -105,8 +110,9 @@ sub afs_quota_adj
     for (@afs_data) {
        local ($c, $as, $ap, $t, $total, $used, $alloc) = split(/\s+/,$_);
        if ($c eq $cell && $as eq $asrv && $ap eq $apart) {
+           $dusage = $used unless ($dusage);
            $alloc += $adj;
-           $_ = join(' ',$c,$asrv,$apart,$t,$total,$used,$alloc);
+           $_ = join(' ',$c,$asrv,$apart,$t,$total,$dusage,$alloc);
            $found = 1;
        }
        print SRV "$_\n";
This page took 0.033533 seconds and 4 git commands to generate.