Skip to content
Snippets Groups Projects
Commit 78d6513c authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '6725-optimize-restic-backup-params' into 'master'

restic: fix replace fqdn in RESTIC_REPOSITORY

See merge request !122
parents 649d69ff a1e70788
No related branches found
No related tags found
1 merge request!122restic: fix replace fqdn in RESTIC_REPOSITORY
......@@ -18,6 +18,7 @@
# 2022-11-04 ah v1.0 one command for forget and prune; rename hooks
# 2023-03-20 ah v1.1 use vss for backup on MS Windows
# 2024-01-23 ah v1.2 prune uses --max-unused unlimited
# 2024-01-31 ah v1.3 fix replace of fqdn
# ================================================================================
# --------------------------------------------------------------------------------
......@@ -38,9 +39,9 @@
# TODO: for restic with https and auth - remove the host in the path
local _target=$( j_getFullTarget )
echo ${_target} | grep "https.*@" >/dev/null
if [ $? -eq 0 ]; then
_target=$( echo $_target | sed "s#${FQDN}/##" )
if grep "^rest:http.*@" <<< "${_target}" >/dev/null; then
local _regex=${FQDN//\./\\.}
_target=$( echo $_target | sed "s#${_regex}/##" )
fi
export RESTIC_REPOSITORY=$_target
......
......@@ -234,18 +234,24 @@ function doRestore(){
h1 "Restore :: Menu"
echo " D - directory to restore: $BACKUP_DIR"
echo -n " W - time or snapshot ID : $RESTORE_ITEM"
echo " D - directory to restore: $( color cmd ; echo -n $BACKUP_DIR; color reset)"
echo
echo "---------- Restore method 1:"
echo
echo " M - mount backup with fuse"
echo
echo "---------- Restore method 2:"
echo
echo -n " W - time or snapshot ID : $( color cmd ; echo -n $RESTORE_ITEM; color reset)"
test -z "$RESTORE_ITEM" && echo -n " ... set one first"
test -z "$RESTORE_ITEMINFO" || echo -n " ($RESTORE_ITEMINFO)"
echo
echo -n " F - what to restore : $RESTORE_FILTER"
echo -n " F - what to restore : $( color cmd ; echo -n $RESTORE_FILTER; color reset)"
test -z "$RESTORE_FILTER" && echo -n "(no filter = restore all files)"
echo
echo
echo " M - mount backup"
# echo " C - show file changes"
# echo " S - search file"
echo " S - search files"
# echo " V - verify"
# echo
echo " R - start restore with $STORAGE_BIN"
......@@ -266,6 +272,8 @@ function doRestore(){
echo "(not set)"
fi
echo
echo "---------- Other:"
echo
echo " B - Bash (Shell)"
echo " X - exit"
echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment