set -o pipefail
set -o pipefail
mysqldump [...] | restic -r /srv/restic-repo backup --stdin
See also
set -o [ vi | pipefail | nounset | errexit ]
set, unset, set -o, set -x, set -e, set +e, set -E, set +b, set -u, $?, exit, return, trap, PostgreSQL SET