From c9732a9418679b9e65af39116cf16a78e0f94fe6 Mon Sep 17 00:00:00 2001 From: AlcibiadesCleinias Date: Mon, 8 Mar 2021 02:06:22 +0300 Subject: [PATCH] flush --- docker_clone_volume_across_servers.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docker_clone_volume_across_servers.sh b/docker_clone_volume_across_servers.sh index bdd5e00..9474b93 100755 --- a/docker_clone_volume_across_servers.sh +++ b/docker_clone_volume_across_servers.sh @@ -1,12 +1,12 @@ #!/bin/bash -#Author: Guido Diepen +# The script repeates docker_clone_volume.sh +# Thanks to maddin25 who provides solution in +# https://stackoverflow.com/questions/42973347/how-to-copy-docker-volume-from-one-machine-to-another -#Convenience script that can help me to easily create a clone of a given -#data volume. The script is mainly useful if you are using named volumes - -# On both hosts you should have running docker diemon -# and have access to root obviously. +# The script is mainly useful if you are using named volumes and +# on both hosts you should have running docker diemon +# and have access to root, obviously. # arg: $1: source volume name # arg: $2: target host @@ -52,6 +52,6 @@ fi docker run --rm \ -v $1:/from alpine ash -c \ - "cd /from ; tar -cf - . " | \ + "cd /from ; tar -cfz - . " | \ ssh $2 \ - "docker run --rm -i -v \"$3\":/to alpine ash -c 'cd /to ; tar -xpvf - '" + "docker run --rm -i -v \"$3\":/to alpine ash -c 'cd /to ; tar -xpvfz - '"