From a0dfb04aa7d0a151e30bd414846b8ba38a6c466b Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Thu, 5 Dec 2019 12:54:34 +0100 Subject: [PATCH] Run repo init in status command --- src/restic_compose_backup/cli.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/restic_compose_backup/cli.py b/src/restic_compose_backup/cli.py index d2203e3..093f4d1 100644 --- a/src/restic_compose_backup/cli.py +++ b/src/restic_compose_backup/cli.py @@ -49,6 +49,9 @@ def status(config, containers): logger.info("Backup currently running?: %s", containers.backup_process_running) logger.info("%s Detected Config %s", "-" * 25, "-" * 25) + logger.info("Initializing repository (may fail if already initalized)") + restic.init_repo(config.repository) + backup_containers = containers.containers_for_backup() for container in backup_containers: logger.info('service: %s', container.service_name) @@ -77,11 +80,6 @@ def backup(config, containers): if containers.backup_process_running: raise ValueError("Backup process already running") - logger.info("Initializing repository (may fail if already initalized)") - - # TODO: Errors when repo already exists - restic.init_repo(config.repository) - # Map all volumes from the backup container into the backup process container volumes = containers.this_container.volumes