mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-23 00:31:03 +01:00
Compare commits
No commits in common. "d537393da847eb33209d481388df91257bef35ec" and "7702b17a9d05ba7d2bd86cfedfabaaea1052514d" have entirely different histories.
d537393da8
...
7702b17a9d
@ -142,7 +142,7 @@ def get_last_backup_dir(volume_name, current_backup_dir):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def getStoragePath(volume_name):
|
def getStoragePath(volume_name):
|
||||||
return execute_shell_command(f"docker volume inspect --format '{{{{ .Mountpoint }}}}' {volume_name}")[0]
|
return execute_shell_command(f"docker volume inspect --format '{{{{ .Mountpoint }}}}' {volume_name}")
|
||||||
|
|
||||||
def backup_volume(volume_name, volume_dir):
|
def backup_volume(volume_name, volume_dir):
|
||||||
"""Backup files of a volume with incremental backups."""
|
"""Backup files of a volume with incremental backups."""
|
||||||
@ -168,15 +168,15 @@ def has_image(container,image):
|
|||||||
|
|
||||||
def stop_containers(containers):
|
def stop_containers(containers):
|
||||||
"""Stop a list of containers."""
|
"""Stop a list of containers."""
|
||||||
container_list = ' '.join(containers)
|
for container in containers:
|
||||||
print(f"Stopping containers {container_list}...")
|
print(f"Stopping container {container}...")
|
||||||
execute_shell_command(f"docker stop {container_list}")
|
execute_shell_command(f"docker stop {container}")
|
||||||
|
|
||||||
def start_containers(containers):
|
def start_containers(containers):
|
||||||
"""Start a list of containers."""
|
"""Start a list of stopped containers."""
|
||||||
container_list = ' '.join(containers)
|
for container in containers:
|
||||||
print(f"Start containers {container_list}...")
|
print(f"Starting container {container}...")
|
||||||
execute_shell_command(f"docker start {container_list}")
|
execute_shell_command(f"docker start {container}")
|
||||||
|
|
||||||
def get_container_with_image(containers,image):
|
def get_container_with_image(containers,image):
|
||||||
for container in containers:
|
for container in containers:
|
||||||
|
Loading…
Reference in New Issue
Block a user