mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-12-22 13:45:03 +01:00
Added condition to stop containers
This commit is contained in:
parent
25d428fc9c
commit
8bc2b068ff
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user