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

update transfer plugins

parent e6a61d1d
No related branches found
No related tags found
1 merge request!1Version 2
...@@ -125,6 +125,16 @@ ...@@ -125,6 +125,16 @@
function t_sd_cmdPost(){ function t_sd_cmdPost(){
} }
# --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function t_cmdShowVolumes(){
}
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# VERIFY RETURNCODES # VERIFY RETURNCODES
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
......
...@@ -190,6 +190,39 @@ export PASSPHRASE ...@@ -190,6 +190,39 @@ export PASSPHRASE
} }
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function t_cmdShowVolumes(){
tmpoutVolumes=/tmp/outvolumelist_$$
echo duplicity collection-status ${sParams} ${sTarget}
color cmd
duplicity collection-status ${sParams} ${sTarget} | tee -a $tmpoutVolumes
fetchrc
color reset
echo
if [ `cat $tmpoutVolumes | egrep "(Full|Incremental)" | wc -l` -eq 0 ]; then
color error
echo "ERROR: no backup sets were found for directory [$sDir2restore]"
echo
color reset
sDir2restore=
setVars
else
color ok
echo "OK, `cat $tmpoutVolumes | grep "Full" | wc -l` Full and `cat $tmpoutVolumes | grep "Incremental" | wc -l` incremental backups"
color reset
fi
rm -f $tmpoutVolumes
}
# --------------------------------------------------------------------------------
# VERIFY RETURNCODES # VERIFY RETURNCODES
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
......
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
# WORKAROUND for bug while writing on a SMB target # WORKAROUND for bug while writing on a SMB target
export GODEBUG="asyncpreemptoff=1" export GODEBUG="asyncpreemptoff=1"
RESTORE_ITEM=latest
RESTORE_FILTER=
RESTORE_CMD=
} }
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
...@@ -196,6 +200,54 @@ ...@@ -196,6 +200,54 @@
echo "Nothing here." echo "Nothing here."
} }
# --------------------------------------------------------------------------------
# RESTORE
# --------------------------------------------------------------------------------
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function t_cmdShowVolumes(){
eval restic snapshots ${sParams} --path $sDir2restore
}
# select a snapshot to restore from
function t_restoreSelect(){
local _selid=
echo "--- Existing snapshots:"
color cmd
t_cmdShowVolumes
color reset
showPrompt "ID of the snapshot to restore from [$RESTORE_ITEM] >"
read _selid
test -z "$_selid" && _selid=$RESTORE_ITEM
RESTORE_ITEM=$_selid
echo using \"$RESTORE_ITEM\"
echo
}
# set a filter to reduce count of files to restore
function t_restoreFilter(){
local _inc=
echo "--- Filter:"
echo "By default all files will be restored."
echo "You can limit it by setting include rules."
echo "You can enter ..."
echo " - a single directory name anywhere in the folderstructure"
echo " - a filename without path"
echo " - a filemask"
showPrompt "Include []>"
read _inc
RESTORE_FILTER="$_sIncParams $( t_getParamInlude "$_inc" )"
echo using parameter \"$RESTORE_FILTER\"
echo
}
# show stored volumes on backup repository
# used in restore; directory param is checked before
# param string name of backup dir, i.e. /etc
function t_cmdRestore(){
echo "eval restic restore ${sParams} --path $sDir2restore --target ${sRestorepath} $RESTORE_FILTER $RESTORE_ITEM"
}
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
# VERIFY RETURNCODES # VERIFY RETURNCODES
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
...@@ -219,7 +271,7 @@ ...@@ -219,7 +271,7 @@
color reset color reset
} }
# repoitory cleanup # repository cleanup
function t_rcCheckCleanup(){ function t_rcCheckCleanup(){
case $1 in case $1 in
0) color ok; echo "OK" ;; 0) color ok; echo "OK" ;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment