changeset 100:d9f9de4bd7a0

docker (libervia_cont): fixed restore when full backup path is used
author Goffi <goffi@goffi.org>
date Fri, 26 Feb 2016 20:20:36 +0100
parents 15e317bb602f
children 83dacf8fda47
files docker/libervia_cont.sh
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/docker/libervia_cont.sh	Fri Feb 26 17:29:34 2016 +0100
+++ b/docker/libervia_cont.sh	Fri Feb 26 20:20:36 2016 +0100
@@ -335,12 +335,13 @@
         fi
 
         printf "restoring $1 to $VOLUME_ALIAS container\n\n"
-        HOST_BACKUP_DIR="$(dirname "$1")"
+        HOST_BACKUP_DIR=$(dirname "$1")
+        HOST_BACKUP_NAME=$(basename "$1")
         if [ $HOST_BACKUP_DIR = "." ]; then
             # workaround for a Docker bug (container crash if "." is used)
             HOST_BACKUP_DIR=$(pwd)
         fi
-        docker run --rm $DK_VOLUME -v "$HOST_BACKUP_DIR:/backup" debian:jessie tar zxvf "/backup/$1" -C / -h volumes
+        docker run --rm $DK_VOLUME -v "$HOST_BACKUP_DIR:/backup" debian:jessie tar zxvf "/backup/$HOST_BACKUP_NAME" -C / -h volumes
         if [ $? -eq 0 ]; then
             printf "\nRestore finished\n"
         else