Another method with gzip directly piped for pg_dumpall.

This commit is contained in:
Benoît S. 2017-04-04 09:47:47 +02:00
parent e5ac7e6e73
commit d461e44609

View file

@ -97,6 +97,10 @@ mkdir -p -m 700 /home/backup
## example with pg_dumpall (warning: you need space in ~postgres)
# su - postgres -c "pg_dumpall > ~/pg.dump.bak"
# mv ~postgres/pg.dump.bak /home/backup/
## another method with gzip directly piped
# cd /var/lib/postgresql
# sudo -u postgres pg_dumpall | gzip > /home/backup/pg.dump.bak.gz
# cd -
## example with all tables from MYBASE excepts TABLE1 and TABLE2
# pg_dump -p 5432 -h 127.0.0.1 -U USER --clean -F t --inserts -f /home/backup/pg-backup.tar -t 'TABLE1' -t 'TABLE2' MYBASE