12 lines
389 B
Bash
12 lines
389 B
Bash
#!/bin/bash -e
|
|
|
|
rm -rf {{ general.backup_dir }}
|
|
mkdir -p {{ general.backup_dir }}
|
|
chown postgres: {{ general.backup_dir }}
|
|
{% for server in accounts.remotes %}
|
|
{% set name = server|normalize_family %}
|
|
{% set database = accounts["remote_" + name]["database_" + name] %}
|
|
su -c "pg_dump -F c -b -v -f {{ general.backup_dir }}/{{ database }}.dump {{ database }}" postgres
|
|
{% endfor %}
|
|
|
|
exit 0
|