From: Valentin Vidic Date: Fri, 15 Mar 2019 11:34:33 +0000 (+0100) Subject: Check all pipe components in db-dump. X-Git-Tag: debian/20190315~3 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=ef088bbd66c271b733e612de0cacddbc5fc8d0ce;p=bacula-cn.git Check all pipe components in db-dump. --- 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