mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Backups: Stream archive downloads/exports
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
82a4a5fc5e
commit
1f9bb624e8
6 files changed
+81
-74
No files matched your search
@@ -60,6 +60,11 @@ def parse_arguments():
|
||||
export_tar.add_argument('--filepath', help='Destination tarball file path',
|
||||
required=True)
|
||||
|
||||
export_stream = subparsers.add_parser('export-stream',
|
||||
help='Export archive contents as tar stream')
|
||||
export_stream.add_argument('--name', help='Archive name)',
|
||||
required=True)
|
||||
|
||||
get_exported_archive_apps = subparsers.add_parser(
|
||||
'get-exported-archive-apps',
|
||||
help='Get list of apps included in exported archive file')
|
||||
@@ -175,6 +180,13 @@ def subcommand_export_tar(arguments):
|
||||
pass
|
||||
|
||||
|
||||
def subcommand_export_stream(arguments):
|
||||
"""Export archive contents as tar stream."""
|
||||
subprocess.run([
|
||||
'borg', 'export-tar', REPOSITORY + '::' + arguments.name, '-'],
|
||||
check=True)
|
||||
|
||||
|
||||
def _read_archive_file(archive, filepath):
|
||||
"""Read the content of a file inside an archive"""
|
||||
arguments = ['borg', 'extract', archive, filepath, '--stdout']
|
||||
|
||||
Reference in new issue
Block a user