[pve-devel] [RFC pve-container 3/3] rsync cleanup

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Sep 16 16:42:04 CEST 2015


It's only one command now, renamed $base to $rsync.
---
 src/PVE/VZDump/LXC.pm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 167e5fb..10ec937 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -24,12 +24,12 @@ my $rsync_vm = sub {
 
     my $opts = $self->{vzdump}->{opts};
 
-    my $base = ['rsync', '--stats', '-X', '--numeric-ids',
-                '-aH', '--delete', '--no-whole-file', '--inplace',
-                '--one-file-system', '--relative'];
-    push @$base, "--bwlimit=$opts->{bwlimit}" if $opts->{bwlimit};
-    push @$base, map { "--exclude=$_" } @{$self->{vzdump}->{findexcl}};
-    push @$base, map { "--exclude=$_" } @{$task->{exclude_dirs}};
+    my $rsync = ['rsync', '--stats', '-X', '--numeric-ids',
+                 '-aH', '--delete', '--no-whole-file', '--inplace',
+                 '--one-file-system', '--relative'];
+    push @$rsync, "--bwlimit=$opts->{bwlimit}" if $opts->{bwlimit};
+    push @$rsync, map { "--exclude=$_" } @{$self->{vzdump}->{findexcl}};
+    push @$rsync, map { "--exclude=$_" } @{$task->{exclude_dirs}};
 
     my $starttime = time();
     # See the rsync(1) manpage for --relative in conjunction with /./ in paths.
@@ -42,9 +42,9 @@ my $rsync_vm = sub {
     # relative to the rootdir, while rsync treats them as relative to the
     # source dir.
     foreach my $disk (@$disks) {
-	push @$base, "$from/.$disk->{mp}";
+	push @$rsync, "$from/.$disk->{mp}";
     }
-    $self->cmd([@$base, $to]);
+    $self->cmd([@$rsync, $to]);
     my $delay = time () - $starttime;
 
     $self->loginfo ("$text sync finished ($delay seconds)");
-- 
2.1.4





More information about the pve-devel mailing list