summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/robust.py
diff options
context:
space:
mode:
authorben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-25 18:54:30 +0000
committerben <ben@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2002-05-25 18:54:30 +0000
commit7a82871f7b6d25464516dd659f3e98cc56211ff1 (patch)
treef0f6c1d0b040769c759e76eeee355776dd453eb8 /rdiff-backup/rdiff_backup/robust.py
parent9b6416eaf5e1691d2e640a5da2a14b4efac38348 (diff)
downloadrdiff-backup-7a82871f7b6d25464516dd659f3e98cc56211ff1.tar.gz
Bugfixed the new statistics stuff
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@108 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/robust.py')
-rw-r--r--rdiff-backup/rdiff_backup/robust.py36
1 files changed, 6 insertions, 30 deletions
diff --git a/rdiff-backup/rdiff_backup/robust.py b/rdiff-backup/rdiff_backup/robust.py
index b38e792..3795bd1 100644
--- a/rdiff-backup/rdiff_backup/robust.py
+++ b/rdiff-backup/rdiff_backup/robust.py
@@ -315,23 +315,16 @@ class SaveState:
_last_checkpoint_time = 0 # time in seconds of last checkpoint
_checkpoint_rp = None # RPath of checkpoint data pickle
- def init_filenames(cls, incrementing):
- """Set rpaths of markers. Assume rbdir already set.
-
- If incrementing, then indicate increment operation, otherwise
- indicate mirror.
-
- """
+ def init_filenames(cls):
+ """Set rpaths of markers. Assume rbdir already set."""
if not Globals.isbackup_writer:
- return Globals.backup_writer.SaveState.init_filenames(incrementing)
+ return Globals.backup_writer.SaveState.init_filenames()
assert Globals.local_connection is Globals.rbdir.conn, \
(Globals.rbdir.conn, Globals.backup_writer)
- if incrementing: cls._last_file_sym = Globals.rbdir.append(
+ cls._last_file_sym = Globals.rbdir.append(
"last-file-incremented.%s.data" % Time.curtimestr)
- else: cls._last_file_sym = Globals.rbdir.append(
- "last-file-mirrored.%s.data" % Time.curtimestr)
cls._checkpoint_rp = Globals.rbdir.append(
"checkpoint-data.%s.data" % Time.curtimestr)
cls._last_file_definitive_rp = Globals.rbdir.append(
@@ -367,8 +360,7 @@ class SaveState:
else: return RobustAction(lambda: None, cls.touch_last_file,
lambda exc: None)
- def checkpoint_inc_backup(cls, ITR, finalizer, last_file_rorp,
- override = None):
+ def checkpoint(cls, ITR, finalizer, last_file_rorp, override = None):
"""Save states of tree reducer and finalizer during inc backup
If override is true, checkpoint even if one isn't due.
@@ -384,20 +376,6 @@ class SaveState:
state_string),
cls.record_last_file_action(last_file_rorp)]).execute()
- def checkpoint_mirror(cls, finalizer, last_file_rorp, override = None):
- """For a mirror, only finalizer and last_file should be saved"""
- if not override and not cls.checkpoint_needed(): return
- if not cls._checkpoint_rp:
- Log("Warning, _checkpoint_rp not set yet", 2)
- return
-
- cls._last_checkpoint_time = time.time()
- Log("Writing checkpoint time %s" % cls._last_checkpoint_time, 7)
- state_string = cPickle.dumps(finalizer)
- Robust.chain([Robust.destructive_write_action(cls._checkpoint_rp,
- state_string),
- cls.record_last_file_action(last_file_rorp)]).execute()
-
def checkpoint_needed(cls):
"""Returns true if another checkpoint is called for"""
return (time.time() > cls._last_checkpoint_time +
@@ -522,9 +500,7 @@ class Resume:
def unpickle_checkpoint(cls, checkpoint_rp):
"""Read data from checkpoint_rp and return unpickled data
- Return value is pair finalizer state for a mirror checkpoint,
- and (patch increment ITR, finalizer state) for increment
- checkpoint.
+ Return value is pair (patch increment ITR, finalizer state).
"""
fp = checkpoint_rp.open("rb")