diff --git a/playbooks/roles/borg-backup/templates/borg-backup.j2 b/playbooks/roles/borg-backup/templates/borg-backup.j2 index 5a05b6e3f9..af9606e435 100644 --- a/playbooks/roles/borg-backup/templates/borg-backup.j2 +++ b/playbooks/roles/borg-backup/templates/borg-backup.j2 @@ -43,12 +43,13 @@ do bash $f | ${BORG_CREATE} --stdin-name ${stream_name} \ ::"{hostname}-${stream_name}-{now}" - - if [[ ${PIPESTATUS[0]} -ne 0 ]]; then + _status=( "${PIPESTATUS[@]}" ) + if [[ ${_status[0]} -ne 0 ]]; then info "Streaming script ${f} failed!" - stream_exit=${PIPESTATUS[0]} - elif [[ ${PIPESTATUS[1]} -ne 1 ]]; then + stream_exit=${_status[0]} + elif [[ ${_status[1]} -ne 1 ]]; then info "Borg failed!" - stream_exit=${PIPESTATUS[1]} + stream_exit=${_status[1]} else stream_exit=0 fi