From ef088bbd66c271b733e612de0cacddbc5fc8d0ce Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Fri, 15 Mar 2019 12:34:33 +0100 Subject: [PATCH] Check all pipe components in db-dump. --- db-dump | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db-dump b/db-dump index 5da3811..f4d795e 100755 --- a/db-dump +++ b/db-dump @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash DUMP_DIR=/var/backups/bacula-cn CONFIG=/etc/default/bacula-cn @@ -32,6 +32,7 @@ then MYSQL_DUMP="$DUMP_DIR/mysql.dump.gz" MYSQL_OPT="--defaults-extra-file=/etc/mysql/debian.cnf --all-databases" + set -o pipefail if mysqldump $MYSQL_OPT | gzip > $MYSQL_DUMP; then touch $MYSQL_EXCLUDE fi @@ -43,6 +44,7 @@ if [ -d /var/lib/postgresql \ then PG_DUMP="$DUMP_DIR/postgresql.dump.gz" + set -o pipefail if su postgres -c pg_dumpall | gzip > $PG_DUMP; then touch $PG_EXCLUDE fi -- 1.7.10.4