From baa8baafdbd342bdaec0e39aa59fc160bea09e2c Mon Sep 17 00:00:00 2001 From: Marian Beermann Date: Sat, 17 Dec 2016 12:55:16 +0100 Subject: [PATCH] create: fix duration if --timestamp is given --- borg/archive.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/borg/archive.py b/borg/archive.py index 64be0f4d8..641fd08dd 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -304,15 +304,17 @@ Number of files: {0.stats.nfiles}'''.format( if name in self.manifest.archives: raise self.AlreadyExists(name) self.items_buffer.flush(flush=True) + duration = timedelta(seconds=time.monotonic() - self.start_monotonic) if timestamp is None: self.end = datetime.utcnow() - self.start = self.end - timedelta(seconds=time.monotonic() - self.start_monotonic) + self.start = self.end - duration start = self.start end = self.end else: self.end = timestamp - start = timestamp - end = timestamp # we only have 1 value + self.start = timestamp - duration + end = timestamp + start = self.start metadata = StableDict({ 'version': 1, 'name': name,