Index: rdiff_backup/backup.py =================================================================== RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/backup.py,v retrieving revision 1.50 diff -u -r1.50 backup.py --- rdiff_backup/backup.py 8 Mar 2009 17:08:14 -0000 1.50 +++ rdiff_backup/backup.py 29 Sep 2011 00:18:09 -0000 @@ -709,6 +709,8 @@ elif mirror_rp.lstat(): mirror_rp.delete() self.CCPP.flag_deleted(index) + elif inc.renamed: + self.CCPP.flag_deleted(index) return # normal return, otherwise error occurred tf.setdata() if tf.lstat(): tf.delete() Index: rdiff_backup/increment.py =================================================================== RCS file: /sources/rdiff-backup/rdiff-backup/rdiff_backup/increment.py,v retrieving revision 1.36 diff -u -r1.36 increment.py --- rdiff_backup/increment.py 14 Jun 2008 16:35:25 -0000 1.36 +++ rdiff_backup/increment.py 29 Sep 2011 00:18:09 -0000 @@ -41,7 +41,7 @@ elif mirror.isdir(): incrp = makedir(mirror, incpref) elif new.isreg() and mirror.isreg(): incrp = makediff(new, mirror, incpref) - else: incrp = makesnapshot(mirror, incpref) + else: incrp = makesnapshot(mirror, incpref, not new.lstat()) statistics.process_increment(incrp) return incrp @@ -56,14 +56,18 @@ return (Globals.compression and not Globals.no_compression_regexp.match(mirror.path)) -def makesnapshot(mirror, incpref): +def makesnapshot(mirror, incpref, renameok): """Copy mirror to incfile, since new is quite different""" compress = iscompressed(mirror) if compress and mirror.isreg(): + renameok = False; snapshotrp = get_inc(incpref, "snapshot.gz") else: snapshotrp = get_inc(incpref, "snapshot") - if mirror.isspecial(): # check for errors when creating special increments + if renameok: + rpath.rename(mirror, snapshotrp) + snapshotrp.renamed = True; + elif mirror.isspecial(): # check for errors when creating special increments eh = robust.get_error_handler("SpecialFileError") if robust.check_common_error(eh, rpath.copy_with_attribs, (mirror, snapshotrp, compress)) == 0: