mirror of https://github.com/borgbackup/borg.git
create: fix duration if --timestamp is given
This commit is contained in:
parent
445365b3ff
commit
baa8baafdb
|
@ -304,15 +304,17 @@ Number of files: {0.stats.nfiles}'''.format(
|
||||||
if name in self.manifest.archives:
|
if name in self.manifest.archives:
|
||||||
raise self.AlreadyExists(name)
|
raise self.AlreadyExists(name)
|
||||||
self.items_buffer.flush(flush=True)
|
self.items_buffer.flush(flush=True)
|
||||||
|
duration = timedelta(seconds=time.monotonic() - self.start_monotonic)
|
||||||
if timestamp is None:
|
if timestamp is None:
|
||||||
self.end = datetime.utcnow()
|
self.end = datetime.utcnow()
|
||||||
self.start = self.end - timedelta(seconds=time.monotonic() - self.start_monotonic)
|
self.start = self.end - duration
|
||||||
start = self.start
|
start = self.start
|
||||||
end = self.end
|
end = self.end
|
||||||
else:
|
else:
|
||||||
self.end = timestamp
|
self.end = timestamp
|
||||||
start = timestamp
|
self.start = timestamp - duration
|
||||||
end = timestamp # we only have 1 value
|
end = timestamp
|
||||||
|
start = self.start
|
||||||
metadata = StableDict({
|
metadata = StableDict({
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'name': name,
|
'name': name,
|
||||||
|
|
Loading…
Reference in New Issue