]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Ignoring PostgreSQL template databases
authorFrank Brehm <frank@brehm-online.com>
Tue, 20 Apr 2021 13:36:15 +0000 (15:36 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 20 Apr 2021 13:36:15 +0000 (15:36 +0200)
bin/manual-backup

index 8ac05d171050ebe67f3ead03602d3c9e189400a7..bedff591a56df53fa694ed77b08b6b5ea4b83163 100755 (executable)
@@ -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"