]> git.proxmox.com Git - pve-container.git/commitdiff
rsync cleanup
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Sep 2015 14:42:04 +0000 (16:42 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Sep 2015 07:08:46 +0000 (09:08 +0200)
It's only one command now, renamed $base to $rsync.

src/PVE/VZDump/LXC.pm

index 912abe45d29003b1d1364f1595e1ca88c3c7ecee..2c0dff7a0d46577ff97f1d2006fa77484e3941cb 100644 (file)
@@ -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)");