Skip to content
Snippets Groups Projects
Commit c9284a67 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

pgbackup.sh: Use psql options and SQL

parent 45c3b508
No related branches found
No related tags found
No related merge requests found
#!/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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment