mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-24 09:11:04 +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
|
return False
|
||||||
|
|
||||||
def backup_with_containers_paused(volume_name, volume_dir, containers, shutdown):
|
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)
|
backup_volume(volume_name, volume_dir)
|
||||||
|
|
||||||
# Just restart containers if shutdown is false
|
# Just restart containers if shutdown is false
|
||||||
|
Loading…
Reference in New Issue
Block a user