summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2015-10-15 13:15:32 +0200
committerPeter Palfrader <peter@palfrader.org>2015-10-15 13:15:32 +0200
commit6182e4c763afdadeb0f232c5257f233dfee970b3 (patch)
tree8d8b5eedb1f6629461b5bfaab8795c5b5211c3d0
parentd835d9dfc5458281b227321b82ab824782226a8a (diff)
Apply patch from Martin W├╝rtele to handle multi-line output by psql -l
-rwxr-xr-xbackup-postgres2
1 files changed, 1 insertions, 1 deletions
diff --git a/backup-postgres b/backup-postgres
index 5779cef..5ed7ceb 100755
--- a/backup-postgres
+++ b/backup-postgres
@@ -30,7 +30,7 @@ DATE=`date "+%Y%m%d-%H%M%S"`
CLIENTBASE=/srv/www/vhosts
SYSBASE=/var/backups/local/pg
-sudo -u postgres psql -l -t | awk '$1 != "" {print $1}' |
+sudo -u postgres psql -l -t | awk '$1 != "" && $1 != "|" {print $1}' |
while read db; do
if [ "$db" = "template0" -o "$db" = "template1" ] ; then
continue;