Commit c9284a67 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

pgbackup.sh: Use psql options and SQL

parent 45c3b508
#!/bin/sh
for DB in $(sudo -u postgres psql -l 2>/dev/null | cut -d" " -f 2 | grep -v -- "---" | grep -v rows | grep -v '^[\t ]*$' | grep -v template)
for DB in $(sudo -u postgres psql -t -q -A -c "select datname from pg_catalog.pg_database where not datname like 'template%';")
do
sudo -u postgres pg_dump -o $DB | gzip -c -- > ${DB}.sql.gz
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment