mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-10-31 23:33:11 +01:00
Added reverse startup of container to solve dependency bug
This commit is contained in:
parent
f3979ce611
commit
468f5c60d4
@ -11,6 +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";
|
||||
reverse_containers="$(docker ps --filter volume="$volume_name" --format '{{.Names}}' | tac)";
|
||||
containers="$(docker ps --filter volume="$volume_name" --format '{{.Names}}')";
|
||||
containers_array=($containers)
|
||||
container=${containers_array[0]}
|
||||
@ -36,7 +37,7 @@ do
|
||||
fi
|
||||
docker run --rm --volumes-from "$container" -v "$backups_folder:$backups_folder" "kevinveenbirkenbach/alpine-rsync" sh -c "
|
||||
rsync -abP --delete --delete-excluded --log-file=$log_path --backup-dir=$raw_backup_dir_path '$source_path/' $raw_destination_path";
|
||||
echo "start containers:" && docker start $containers;
|
||||
echo "start containers:" && docker start $reverse_containers;
|
||||
done
|
||||
echo "end backup routine: $volume_name";
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user