pgbackup-bullseye.sh 283 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
#!/bin/sh

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 $DB | gzip -c -- > ${DB}.sql.gz
done

sudo -u postgres pg_dumpall -g -U postgres | gzip -c -- > pg_dumpall.sql.gz