Skip to content
Snippets Groups Projects
Commit 4a483e42 authored by Lars Beckers's avatar Lars Beckers
Browse files

postgres: add backup script compat for bullseye

parent 2063e368
Branches
No related tags found
1 merge request!3Bullseye Compatibility
Pipeline #2898 passed
#!/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 @@ ...@@ -38,8 +38,8 @@
- name: ensure we have our postgres backup script - name: ensure we have our postgres backup script
copy: copy:
src: pgbackup.sh src: "pgbackup{{ '-bullseye' if ansible_distribution_major_version|int(default=99) > 10 else '' }}.sh"
dest: /usr/local/bin/ dest: /usr/local/bin/pgbackup.sh
owner: root owner: root
group: root group: root
mode: '0755' mode: '0755'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment