From 8e06fe970903b95547a95e8ff419f2c0b74b24c2 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Fri, 22 Sep 2023 22:07:28 +1000 Subject: [PATCH] Create restoration base as needed --- restore.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/restore.sh b/restore.sh index 92faab6..872a9eb 100755 --- a/restore.sh +++ b/restore.sh @@ -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 } -- 2.39.2