bundlewrap/bundles/postgresql/files/backup-pre-hook

10 lines
239 B
Text
Raw Permalink Normal View History

#!/bin/bash
target="/var/tmp/postgresdumps"
pg_dumpall --globals-only | gzip --quiet --rsyncable >"$target/globals.sql.gz"
% for db in sorted(databases):
pg_dump -C "${db}" | gzip --quiet --rsyncable >"$target/db_${db}.sql.gz"
% endfor