New step verify (against profile settings only for now)
Enhanced step restore with more options
This commit is contained in:
@@ -16,6 +16,9 @@ EBU_TARGET=
|
||||
# base directory to backup
|
||||
EBU_SOURCE=
|
||||
|
||||
# Change the volume size to number MB. Default is 200MB.
|
||||
#EBU_VOLSIZE=
|
||||
|
||||
# a command that runs duplicity e.g.
|
||||
# shape bandwidth use via trickle
|
||||
# "trickle -s -u 640 -d 5120" # 5Mb up, 40Mb down"
|
||||
|
@@ -40,7 +40,6 @@ step_1() {
|
||||
|
||||
local arg
|
||||
local dupArgs
|
||||
local dupCommand
|
||||
local purgeAfter=1
|
||||
|
||||
for arg in "$@" ; do
|
||||
@@ -58,7 +57,7 @@ step_1() {
|
||||
fi
|
||||
|
||||
if [ ! -z "$1" ] && ( [ "$1" == "full" ] || [ "$1" == "incremental" ] ) ; then
|
||||
dupCommand="$1"
|
||||
dupArgs+=("$1")
|
||||
elif [ ! -z "$1" ] ; then
|
||||
echo " [W] $toolName command \"$1\" not recognized"
|
||||
return -1
|
||||
@@ -66,13 +65,16 @@ step_1() {
|
||||
|
||||
echo " [I] Running backup profile [$SEQ_PROFILE_NAME]"
|
||||
|
||||
if [ "$dupCommand" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then
|
||||
dupArgs+="--full-if-older-than=$EBU_MAX_FULLBKP_AGE "
|
||||
if [ "${dupArgs[0]}" != "full" ] && [ ! -z "$EBU_MAX_FULLBKP_AGE" ] ; then
|
||||
dupArgs+=(--full-if-older-than "$EBU_MAX_FULLBKP_AGE")
|
||||
fi
|
||||
if [ ! -z "$EBU_VOLSIZE" ] ; then
|
||||
dupArgs+=(--volsize "$EBU_VOLSIZE")
|
||||
fi
|
||||
|
||||
checkInstalled
|
||||
setPassphrase
|
||||
exe $toolBin $dupCommand $dupArgs "$EBU_SOURCE" "$EBU_TARGET"
|
||||
exe $toolBin "${dupArgs[@]}" "$EBU_SOURCE" "$EBU_TARGET"
|
||||
unsetPassphrase
|
||||
|
||||
if [ $purgeAfter -ne 0 ] ; then
|
||||
@@ -80,10 +82,51 @@ step_1() {
|
||||
fi
|
||||
}
|
||||
|
||||
step_3_info() { echo "Restore <LOCAL TARGET> [TARGET]"; }
|
||||
step_3_alias() { ALIAS="restore"; }
|
||||
step_3_info() { echo "Verify selected backup"; }
|
||||
step_3_alias() { ALIAS="verify"; }
|
||||
step_3() {
|
||||
shift
|
||||
|
||||
if [ -z $EBU_TARGET ] || [ -z $EBU_SOURCE ] ; then
|
||||
echo " [I] Nothing to do. Check $SEQ_CONFIG_FILE"
|
||||
return -1
|
||||
fi
|
||||
|
||||
checkInstalled
|
||||
setPassphrase
|
||||
exe $toolBin verify "$EBU_TARGET" "$EBU_SOURCE"
|
||||
unsetPassphrase
|
||||
}
|
||||
|
||||
step_5_info() {
|
||||
echo "Restore [OPTIONS] <LOCAL TARGET> [TARGET]"
|
||||
echoinfo " [OPTIONS]"
|
||||
echoinfo " --file-to-restore, -f <RELPATH> : Relative path within backup"
|
||||
echoinfo " (file or folder)"
|
||||
echoinfo " --time, -t <TIME> : Age of file to be restored"
|
||||
}
|
||||
step_5_alias() { ALIAS="restore"; }
|
||||
step_5() {
|
||||
shift
|
||||
|
||||
local arg
|
||||
local restoreOpt
|
||||
|
||||
for arg in "$@" ; do
|
||||
case "$1" in
|
||||
--file-to-restore|-f)
|
||||
shift
|
||||
restoreOpt+=(--file-to-restore "$1")
|
||||
shift
|
||||
;;
|
||||
--time|-t)
|
||||
shift
|
||||
restoreOpt=(-t "$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$1" ] ; then
|
||||
echoerr " [E] No target provided"
|
||||
return -1
|
||||
@@ -96,13 +139,13 @@ step_3() {
|
||||
|
||||
checkInstalled
|
||||
setPassphrase
|
||||
exe $toolBin restore "$EBU_TARGET" "$ebuLocalTarget"
|
||||
exe $toolBin restore "${restoreOpt[@]}" "$EBU_TARGET" "$ebuLocalTarget"
|
||||
unsetPassphrase
|
||||
}
|
||||
|
||||
step_5_info() { echo "Purge old backups [TARGET]"; }
|
||||
step_5_alias() { ALIAS="purge"; }
|
||||
step_5() {
|
||||
step_7_info() { echo "Purge old backups [TARGET]"; }
|
||||
step_7_alias() { ALIAS="purge"; }
|
||||
step_7() {
|
||||
shift
|
||||
local ebuTarget="$EBU_TARGET"
|
||||
local dupCommand=
|
||||
|
Reference in New Issue
Block a user