Commit 4a483e42 authored by Lars Beckers's avatar Lars Beckers
Browse files

postgres: add backup script compat for bullseye

parent 2063e368
Pipeline #2898 passed with stage
in 29 seconds
#!/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
......@@ -38,8 +38,8 @@
- name: ensure we have our postgres backup script
copy:
src: pgbackup.sh
dest: /usr/local/bin/
src: "pgbackup{{ '-bullseye' if ansible_distribution_major_version|int(default=99) > 10 else '' }}.sh"
dest: /usr/local/bin/pgbackup.sh
owner: root
group: root
mode: '0755'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment