From 8bc2b068ff7723d94e81286ec312b774d0a65497 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 12 Jan 2024 18:58:02 +0100 Subject: [PATCH] Added condition to stop containers --- backup-docker-to-local.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backup-docker-to-local.py b/backup-docker-to-local.py index a872fec..a553ac1 100644 --- a/backup-docker-to-local.py +++ b/backup-docker-to-local.py @@ -217,7 +217,10 @@ def is_image_ignored(container): return False def backup_with_containers_paused(volume_name, volume_dir, containers, shutdown): - stop_containers(containers) + if containers: + stop_containers(containers) + else: + print(f"{volume_name} has no containers to stop. Skipped.") backup_volume(volume_name, volume_dir) # Just restart containers if shutdown is false