mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-26 04:32:42 +01:00
restic: use eval to execute restic
Without it, the single-quoted paths on the command-line are interperted literally, leading restic find all include paths invalid...
This commit is contained in:
parent
f71d6882c6
commit
b94b3639ff
@ -211,7 +211,7 @@ execstr="${cmd} ${cmd_global_options//$'\n'}"
|
||||
|
||||
debug "executing restic snapshots"
|
||||
debug "$execstr"
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
@ -245,7 +245,7 @@ if [ "$need_init" = "yes" ]; then
|
||||
else
|
||||
info "Initializing repository at $repository"
|
||||
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
@ -344,7 +344,7 @@ if [ "$run_backup" == "yes" ]; then
|
||||
info "Test mode enabled, skipping restic backup."
|
||||
else
|
||||
info "Creating new backup snapshot."
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
debug $output
|
||||
@ -450,7 +450,7 @@ if [[ "$run_forget" == "yes" ]]; then
|
||||
info "Test mode enabled, skipping restic forget."
|
||||
else
|
||||
info "Removing old snapshots based on defined retention policy."
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
debug $output
|
||||
@ -486,7 +486,7 @@ if [ "$run_prune" == "yes" ]; then
|
||||
info "Test mode enabled, skipping restic prune."
|
||||
else
|
||||
info "Removing unreferenced data from repository."
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
debug $output
|
||||
@ -540,7 +540,7 @@ if [ "$run_check" == "yes" ]; then
|
||||
info "Test mode enabled, skipping restic check."
|
||||
else
|
||||
info "Checking repository integrity and consistency."
|
||||
output=$($execstr 2>&1)
|
||||
output=$(eval $execstr 2>&1)
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
debug $output
|
||||
|
Loading…
Reference in New Issue
Block a user