diff --git a/backup.sh b/backup.sh index ea34f60..8b8d739 100644 --- a/backup.sh +++ b/backup.sh @@ -29,7 +29,9 @@ if [ -n "$BACKUP_HELPER_COMMANDS" ]; then for pair in "${pairs[@]}"; do IFS=":" read -r key value <<< "$pair" - if ! output=$(restic backup --stdin-filename "$key" --stdin-from-command -- "$value"); then + # Split value into array of command args + IFS=' ' read -r -a cmd_parts <<< "$value" + if ! output=$(restic backup --stdin-filename "$key" --stdin-from-command -- "${cmd_parts[@]}"); then exit_code=1; echo "Backup of $i failed with exit code $?:" echo "$output"