Added condition to stop containers

This commit is contained in:
Kevin Veen-Birkenbach 2024-01-12 18:58:02 +01:00
parent 25d428fc9c
commit 8bc2b068ff

View File

@ -217,7 +217,10 @@ def is_image_ignored(container):
return False return False
def backup_with_containers_paused(volume_name, volume_dir, containers, shutdown): def backup_with_containers_paused(volume_name, volume_dir, containers, shutdown):
if containers:
stop_containers(containers) stop_containers(containers)
else:
print(f"{volume_name} has no containers to stop. Skipped.")
backup_volume(volume_name, volume_dir) backup_volume(volume_name, volume_dir)
# Just restart containers if shutdown is false # Just restart containers if shutdown is false