]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
Save VE configuration files from HN on VE backup.
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 10 Jan 2008 23:00:36 +0000 (23:00 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Thu, 10 Jan 2008 23:00:36 +0000 (23:00 +0000)
BackupPC_ovz

index 830de2cc98bb50d671b783d2d69d4d477911a970..2e0db7cb827824dccc80cd21d64269c96f915703 100755 (executable)
@@ -116,7 +116,7 @@ sub loadVeList()
   close($fh);
 }
 
-# For use on the HN
+# For use on the HN.  Derive the VE record from its VEID.
 sub localVe($)
 {
   my ($veid) = @_;
@@ -341,7 +341,8 @@ sub saveConfigs($)
   my ($ve) = @_;
   die "No VE record for saveConfigs" if (!defined($ve));
 
-  # Copy configuration and other scripts belonging to VE into VE's snapshot
+  # Copy configuration and other scripts belonging to VE into VE's snapshot.
+  # Do this in a manner similar to that supported by vzdump for consistency.
   my $snapprivate = $ve->{'snapprivate'};
   mkpath "$snapprivate/etc/vzdump";
   my $conffile = $ve->{'conffile'};
@@ -432,8 +433,12 @@ sub runClient($)
     die "Failed to make snapshot of filesystem for VE $veid"
        if (!defined($ve->{'snaproot'}));
 
+    # Save the VE configuration from its hosted HN into the filesystem.  If
+    # /etc is backed up, so will the VE configuration.
+    saveConfigs($ve);
+
     # Make and exec the backup command.  Do it in a chroot to the snapshot
-    # of the VE's root dir so that any relative path information in the
+    # of the VEs root dir so that any relative path information in the
     # backup command is accurate.  This does mean that each VE needs rsync,
     # etc.
     my $cmd = "chroot ".$ve->{'snapprivate'}." ".join(' ', @ARGV);