diff options
author | Peter Palfrader <peter@palfrader.org> | 2015-10-15 13:15:32 +0200 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2015-10-15 13:15:32 +0200 |
commit | 6182e4c763afdadeb0f232c5257f233dfee970b3 (patch) | |
tree | 8d8b5eedb1f6629461b5bfaab8795c5b5211c3d0 /backup-postgres | |
parent | d835d9dfc5458281b227321b82ab824782226a8a (diff) |
Apply patch from Martin Würtele to handle multi-line output by psql -l
Diffstat (limited to 'backup-postgres')
-rwxr-xr-x | backup-postgres | 2 |
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; |