From b90b04a57ef658f5f33ac2c25389b25eff819992 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 20 Apr 2021 15:36:15 +0200 Subject: [PATCH] Ignoring PostgreSQL template databases --- bin/manual-backup | 4 ++++ 1 file changed, 4 insertions(+) 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" -- 2.39.5