[PVE-User] pve-user Digest, Vol 26, Issue 1

Dietmar Maurer dietmar at proxmox.com
Tue May 11 12:24:25 CEST 2010


> Is it possible to have a diff here?

Index: Storage.pm
===================================================================
--- Storage.pm  (revision 4750)
+++ Storage.pm  (working copy)
@@ -1450,7 +1450,17 @@
                run_command (['/usr/bin/ssh', "root\@${target_host}", 
                              '/bin/mkdir', '-p', $dirname]);
 
-               my $cmd = ['/usr/bin/rsync', '--sparse', '--progress', '--inplace', '--no-whole-file', 
+               # we use rsync with --sparse, so we can't use --inplace,
+               # so we remove file on the target if it already exists to
+               # save space
+               my ($size, $format) = file_size_info($src);
+               if ($format && ($format eq 'raw') && $size) {
+                   run_command (['/usr/bin/ssh', "root\@${target_host}", 
+                                 'rm', '-f', $dst],
+                                outfunc => sub {});
+               }
+
+               my $cmd = ['/usr/bin/rsync', '--progress', '--sparse', '--whole-file', 
                           $src, "root\@${target_host}:$dst"];
 
                my $percent = -1;





More information about the pve-user mailing list