Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
infra
ansible-shared
databases
Commits
4a483e42
Commit
4a483e42
authored
Mar 15, 2021
by
Lars Beckers
Browse files
postgres: add backup script compat for bullseye
parent
2063e368
Pipeline
#2898
passed with stage
in 29 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
postgres/files/pgbackup-bullseye.sh
0 → 100755
View file @
4a483e42
#!/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
postgres/tasks/main.yml
View file @
4a483e42
...
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment