Skip to content

Commit

Permalink
Merge pull request #1005 from tesshuflower/restic_dest_job_errhandling
Browse files Browse the repository at this point in the history
restic restore run cmd separately to capture error
  • Loading branch information
openshift-merge-bot[bot] authored Nov 29, 2023
2 parents b1111d8 + ab3811c commit 7dd3dc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mover-restic/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ function select_restic_snapshot_to_restore() {
# create an associative array that maps numeric epoch to the restic snapshot IDs
declare -A epochs_to_snapshots

local restic_snapshots
if ! restic_snapshots=$("${RESTIC[@]}" -r "${RESTIC_REPOSITORY}" snapshots); then
error 3 "failure getting list of snapshots from repository"
fi

# declare vars to be used in the loop
local snapshot_id
local snapshot_ts
Expand All @@ -190,7 +195,7 @@ function select_restic_snapshot_to_restore() {

# go through the timestamps received from restic
IFS=$'\n'
for line in $("${RESTIC[@]}" -r "${RESTIC_REPOSITORY}" snapshots | grep /data | awk '{print $1 "\t" $2 " " $3}'); do
for line in $(echo -e "${restic_snapshots}" | grep /data | awk '{print $1 "\t" $2 " " $3}'); do
# extract the proper variables
snapshot_id=$(echo -e "${line}" | cut -d$'\t' -f1)
snapshot_ts=$(echo -e "${line}" | cut -d$'\t' -f2)
Expand Down

0 comments on commit 7dd3dc1

Please sign in to comment.