mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-12-22 21:55:03 +01:00
just backup running containers
This commit is contained in:
parent
5cc5a6e5e5
commit
76d32a2e5c
@ -11,7 +11,7 @@ backup_repository_folder="$backups_folder$machine_id/$repository_name/";
|
||||
for volume_name in $(docker volume ls --format '{{.Name}}');
|
||||
do
|
||||
echo "start backup routine: $volume_name";
|
||||
for container_name in $(docker ps -a --filter volume="$volume_name" --format '{{.Names}}');
|
||||
for container_name in $(docker ps --filter volume="$volume_name" --format '{{.Names}}');
|
||||
do
|
||||
echo "stop container: $container_name" && docker stop "$container_name"
|
||||
for source_path in $(docker inspect --format "{{ range .Mounts }}{{ if eq .Type \"volume\"}}{{ if eq .Name \"$volume_name\"}}{{ println .Destination }}{{ end }}{{ end }}{{ end }}" "$container_name");
|
||||
|
Loading…
Reference in New Issue
Block a user