It seems that the change to support this would be minimal, see below.
All file writing during restore seems to be done by
util.py/copyfileobj()

Unless I'm very much mistaken, the following change would do sparse
files, _if_ (and only if) the target object is empty to begin with. If
it isn't, this will keep blocks with old content when it shouldn't(big
caveat).

             if all([ b == 0 for b in buf ]):                                   
                   
                 outfp.seek(len(buf), 1) # Move forward len(buf) bytes          
                   
             else:                                                              
                   
                 bytes_written += len(buf)                                      
                   
                 outfp.write(buf)                                               
                   
 
as the replacement for what previously were the last two lines of the above.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to duplicity in Ubuntu.
https://bugs.launchpad.net/bugs/1576051

Title:
  Duplicity cannot handle sparse files efficiently

Status in Duplicity:
  Confirmed
Status in duplicity package in Ubuntu:
  Confirmed

Bug description:
  When running backup with duplicity, it cannot handle sparse files
  efficiently.

  I have a virtual machine image on my home dir,

  26G -rw-r--r-- 1 libvirt-qemu kvm 33G huhti 28 08:59 dev02.img

  And duplicity is backing it up 33G, when it should only back up 26G.

  Steps to reproduce

  1. Use qemu-image to create a sparse file
  2. Run duplicity
  3. Observe duplicity back it up whole instead of very small size

To manage notifications about this bug go to:
https://bugs.launchpad.net/duplicity/+bug/1576051/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to