From b364d9b83ceb66bd9c8a9933e2a672410473ee1b Mon Sep 17 00:00:00 2001 From: bescoto Date: Sat, 1 Nov 2003 17:44:43 +0000 Subject: Deleted base increments first to save disk space git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@481 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 6 +++++- rdiff-backup/rdiff_backup/regress.py | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 83c38c5..f720c35 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -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) diff --git a/rdiff-backup/rdiff_backup/regress.py b/rdiff-backup/rdiff_backup/regress.py index acee41f..f366e96 100644 --- a/rdiff-backup/rdiff_backup/regress.py +++ b/rdiff-backup/rdiff_backup/regress.py @@ -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 -- cgit v1.2.1