1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2025-01-02 21:25:48 +00:00

borg2: support >= b10, drop support for < b10. By @ThomasWaldmann (#2102)

- new repo-* commands (previously: r*)
- some stats are gone
This commit is contained in:
TW 2024-10-20 13:35:45 +02:00 committed by GitHub
parent e631cc45b2
commit 5dada30d9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 7 additions and 7 deletions

View file

@ -7,7 +7,7 @@
'DIFF_JSON_LINES': parse_version('1.1.16'), 'DIFF_JSON_LINES': parse_version('1.1.16'),
'COMPACT_SUBCOMMAND': parse_version('1.2.0a1'), 'COMPACT_SUBCOMMAND': parse_version('1.2.0a1'),
'V122': parse_version('1.2.2'), 'V122': parse_version('1.2.2'),
'V2': parse_version('2.0.0b1'), 'V2': parse_version('2.0.0b10'),
# add new version-checks here. # add new version-checks here.
} }

View file

@ -294,7 +294,7 @@ def read_async(fd):
f"{translate('BorgJob','Files')}: {parsed['nfiles']}, " f"{translate('BorgJob','Files')}: {parsed['nfiles']}, "
f"{translate('BorgJob','Original')}: {pretty_bytes(parsed['original_size'])}, " f"{translate('BorgJob','Original')}: {pretty_bytes(parsed['original_size'])}, "
# f"{translate('BorgJob','Compressed')}: {pretty_bytes(parsed['compressed_size'])}, " # f"{translate('BorgJob','Compressed')}: {pretty_bytes(parsed['compressed_size'])}, "
f"{translate('BorgJob','Deduplicated')}: {pretty_bytes(parsed['deduplicated_size'])}" # noqa: E501 f"{translate('BorgJob','Deduplicated')}: {pretty_bytes(parsed.get('deduplicated_size', 0))}" # noqa: E501
) )
self.app.backup_progress_event.emit(f"[{self.params['profile_name']}] {msg}") self.app.backup_progress_event.emit(f"[{self.params['profile_name']}] {msg}")
except json.decoder.JSONDecodeError: except json.decoder.JSONDecodeError:

View file

@ -27,12 +27,12 @@ def process_result(self, result):
'time': dt.fromisoformat(result['data']['archive']['start']).replace(tzinfo=None), 'time': dt.fromisoformat(result['data']['archive']['start']).replace(tzinfo=None),
'repo': result['params']['repo_id'], 'repo': result['params']['repo_id'],
'duration': result['data']['archive']['duration'], 'duration': result['data']['archive']['duration'],
'size': result['data']['archive']['stats']['deduplicated_size'], 'size': result['data']['archive']['stats'].get('deduplicated_size', 0),
'trigger': result['params'].get('category', 'user'), 'trigger': result['params'].get('category', 'user'),
}, },
) )
new_archive.save() new_archive.save()
if 'cache' in result['data'] and created: if created and 'cache' in result['data'] and 'stats' in result['data']['cache']:
stats = result['data']['cache']['stats'] stats = result['data']['cache']['stats']
repo = RepoModel.get(id=result['params']['repo_id']) repo = RepoModel.get(id=result['params']['repo_id'])
repo.total_size = stats['total_size'] repo.total_size = stats['total_size']

View file

@ -30,7 +30,7 @@ def prepare(cls, params):
ret['ok'] = False # Set back to false, so we can do our own checks here. ret['ok'] = False # Set back to false, so we can do our own checks here.
if borg_compat.check('V2'): if borg_compat.check('V2'):
cmd = ["borg", "rinfo", "--info", "--json", "--log-json", "-r"] cmd = ["borg", "repo-info", "--info", "--json", "--log-json", "-r"]
else: else:
cmd = ["borg", "info", "--info", "--json", "--log-json"] cmd = ["borg", "info", "--info", "--json", "--log-json"]
cmd.append(profile.repo.url) cmd.append(profile.repo.url)

View file

@ -33,7 +33,7 @@ def prepare(cls, params):
if borg_compat.check('V2'): if borg_compat.check('V2'):
cmd = [ cmd = [
"borg", "borg",
"rcreate", "repo-create",
"--info", "--info",
"--log-json", "--log-json",
f"--encryption={params['encryption']}", f"--encryption={params['encryption']}",

View file

@ -25,7 +25,7 @@ def prepare(cls, profile):
ret['ok'] = False # Set back to false, so we can do our own checks here. ret['ok'] = False # Set back to false, so we can do our own checks here.
if borg_compat.check('V2'): if borg_compat.check('V2'):
cmd = ['borg', 'rlist', '--info', '--log-json', '--json', '-r'] cmd = ['borg', 'repo-list', '--info', '--log-json', '--json', '-r']
else: else:
cmd = ['borg', 'list', '--info', '--log-json', '--json'] cmd = ['borg', 'list', '--info', '--log-json', '--json']
cmd.append(f'{profile.repo.url}') cmd.append(f'{profile.repo.url}')