mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-28 14:45:23 +00:00
rcb snapshots
This commit is contained in:
@@ -23,6 +23,9 @@ def main():
|
||||
if args.action == 'status':
|
||||
status(config, containers)
|
||||
|
||||
if args.action == 'snapshots':
|
||||
snapshots(config, containers)
|
||||
|
||||
elif args.action == 'backup':
|
||||
backup(config, containers)
|
||||
|
||||
@@ -56,6 +59,12 @@ def status(config, containers):
|
||||
|
||||
logger.info("-" * 67)
|
||||
|
||||
def snapshots(config, containers):
|
||||
"""Display restic snapshots"""
|
||||
stdout, stderr = restic.snapshots(config.repository)
|
||||
for line in stdout.decode().split('\n'):
|
||||
logger.info('| %s', line)
|
||||
|
||||
|
||||
def backup(config, containers):
|
||||
"""Request a backup to start"""
|
||||
@@ -134,7 +143,7 @@ def parse_args():
|
||||
parser = argparse.ArgumentParser(prog='restic_compose_backup')
|
||||
parser.add_argument(
|
||||
'action',
|
||||
choices=['status', 'backup', 'start-backup-process'],
|
||||
choices=['status', 'snapshots', 'backup', 'start-backup-process'],
|
||||
)
|
||||
parser.add_argument(
|
||||
'--log-level',
|
||||
|
Reference in New Issue
Block a user