Create restoration base as needed
authorRalph Ronnquist <rrq@rrq.au>
Fri, 22 Sep 2023 12:07:28 +0000 (22:07 +1000)
committerRalph Ronnquist <rrq@rrq.au>
Fri, 22 Sep 2023 12:07:28 +0000 (22:07 +1000)
restore.sh

index 92faab62e392d7c20a484444bbf04a10ebfb9858..872a9eba12bc0d13c70e29f322a6a4237ead7874 100755 (executable)
@@ -60,20 +60,21 @@ Options    = $OPTIONS
 EOF
     read -p "Go ahead [Yn]?" X
     [ "$X" = n ] && return 0
+    mkdir -p "$RESTORE/$TIME$BASE" || return 1
     duplicity restore $OPTIONS --file-to-restore "$1" --time "$TIME" \
              "pexpect+scp://$URI" "$RESTORE/$TIME$BASE/$1"
 }
 
 # $1 root
 browse() {
-    local X Y
+    local X 
     while true ; do
        X="$(grep -oE "^$1[^/]*/?" < $LIST | uniq | iselect -fa)"
        [ -z "$X" ] && break
        if [ -z "${X##*/}" ] ; then
            browse "$X"
        else
-           restore "$X"
+           restore "$X" || read -p "push enter" X
        fi
     done
 }