From c9ba66d43a5b49494c2fb142f2d36718a1636be3 Mon Sep 17 00:00:00 2001 From: smckown Date: Thu, 10 Jan 2008 23:00:36 +0000 Subject: [PATCH] Save VE configuration files from HN on VE backup. --- BackupPC_ovz | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/BackupPC_ovz b/BackupPC_ovz index 830de2c..2e0db7c 100755 --- a/BackupPC_ovz +++ b/BackupPC_ovz @@ -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); -- 2.39.2