Skip to content
Snippets Groups Projects
Commit b94b3639 authored by Jérôme Charaoui's avatar Jérôme Charaoui
Browse files

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...
parent f71d6882
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment