From: Frank Brehm Date: Tue, 20 Apr 2021 13:36:15 +0000 (+0200) Subject: Ignoring PostgreSQL template databases X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=b90b04a57ef658f5f33ac2c25389b25eff819992;p=pixelpark%2Fadmin-tools.git Ignoring PostgreSQL template databases --- diff --git a/bin/manual-backup b/bin/manual-backup index 8ac05d1..bedff59 100755 --- a/bin/manual-backup +++ b/bin/manual-backup @@ -362,6 +362,10 @@ do_postgres_backup() { for db in $( su - postgres -c "psql -X -x --list --tuples-only --no-align" | \ grep -i '^name|' | awk -F'|' '{print $2}' ) ; do + if [[ "${db}" =~ ^template ]] ; then + debug "Ignoring PostgreSQL database '${CYAN}${db}${NORMAL}'." + continue + fi debug "Dumping PostgreSQL database '${CYAN}${db}${NORMAL}' ..." dumpfile="${BACKUP_DIR}/postgres.${db}.dump.sql.gz" cmd="su - postgres -c \"pg_dump"