From 196c59962b151acd717953520c115bbec1bebdd8 Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 19 Apr 2019 02:18:32 +0200 Subject: [PATCH] Mount backup volumes into the backup process container --- restic_volume_backup/cli.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/restic_volume_backup/cli.py b/restic_volume_backup/cli.py index a45aca9..d0380e3 100644 --- a/restic_volume_backup/cli.py +++ b/restic_volume_backup/cli.py @@ -1,4 +1,5 @@ import argparse +import pprint import sys from restic_volume_backup.config import Config @@ -59,10 +60,19 @@ def backup(config, containers): restic.init_repo(config.repository) print("Starting backup container..") + + # Map all volumes from the backup container into the backup process container + volumes = containers.this_container.volumes() + + # Map volumes from other containers we are backing up + mounts = containers.generate_backup_mounts('/backup') + volumes.update(mounts) + pprint.pprint(volumes, indent=2) + backup_runner.run( image=containers.this_container.image, command='restic-volume-backup start-backup-process', - volumes=containers.this_container.volumes, + volumes=volumes, enviroment=containers.this_container.environment, labels={ "restic-volume-backup.backup_process": 'True',