dataset/seed/postgresql/templates/risotto_backup

13 lines
389 B
Text
Raw Permalink Normal View History

2023-06-23 08:12:05 +02:00
#!/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