Commit 49b179ae authored by bescoto's avatar bescoto

Deleted base increments first to save disk space


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@481 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent beaecda9
......@@ -2,7 +2,11 @@ New in v0.13.4 (??????????)
---------------------------
Regressing and restoring should now take less memory when processing
large directories.
large directories (noticed by Luke Mewburn and others).
When regressing, remove mirror_metadata and similar increments first.
This will hopefully help regressing a backup that failed because disk
was full (reported by Erik Forsberg).
New in v0.13.3 (2003/10/14)
......
......@@ -65,10 +65,13 @@ def Regress(mirror_rp):
assert mirror_rp.conn is inc_rpath.conn is Globals.local_connection
set_regress_time()
set_restore_times()
former_current_mirror_rp = remove_rbdir_increments()
ITR = rorpiter.IterTreeReducer(RegressITRB, [])
for rf in iterate_meta_rfs(mirror_rp, inc_rpath): ITR(rf.index, rf)
ITR.Finish()
remove_rbdir_increments()
if former_current_mirror_rp:
C.sync() # Sync first, since we are marking dest dir as good now
former_current_mirror_rp.delete()
def set_regress_time():
"""Set global regress_time to previous sucessful backup
......@@ -98,18 +101,23 @@ def set_restore_times():
restore._rest_time = regress_time
def remove_rbdir_increments():
"""Delete the increments in the rdiff-backup-data directory"""
old_current_mirror = None
"""Delete the increments in the rdiff-backup-data directory
Returns the former current mirror rp so we can delete it later.
All of the other rp's should be deleted before the actual regress,
to clear up disk space the rest of the procedure may need.
"""
former_current_mirror = None
for filename in Globals.rbdir.listdir():
rp = Globals.rbdir.append(filename)
if rp.isincfile() and rp.getinctime() == unsuccessful_backup_time:
if rp.getincbase_str() == "current_mirror": old_current_mirror = rp
if rp.getincbase_str() == "current_mirror":
former_current_mirror = rp
else:
log.Log("Removing rdiff-backup-data increment " + rp.path, 5)
rp.delete()
if old_current_mirror:
C.sync() # Sync first, since we are marking dest dir as good now
old_current_mirror.delete()
return former_current_mirror
def iterate_raw_rfs(mirror_rp, inc_rp):
"""Iterate all RegressFile objects in mirror/inc directory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment