bundlewrap/bundles/postgresql/files/backup-pre-hook
Franziska Kunsmann 724537558e
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles/postgresql: do a database dump before backing up the database
2021-02-13 08:56:35 +01:00

9 lines
239 B
Bash

#!/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