Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
692 B

#!/bin/bash -e
{% if mayan_db_engine == 'mysql' %}
/usr/bin/mysqldump --user={{ mayan_db_user | quote }} \
--password={{ mayan_db_pass | quote }} \
--host={{ mayan_db_server | quote }} \
--quick --single-transaction \
--add-drop-table {{ mayan_db_name | quote }} | zstd -c > {{ mayan_root_dir }}/backup/{{ mayan_db_name }}.sql.zst
{% else %}
PGPASSWORD='{{ mayan_db_pass }}' /usr/pgsql-13/bin/pg_dump \
--clean \
--username={{ mayan_db_user | quote }} \
--host={{ mayan_db_server | quote }} \
{{ mayan_db_name | quote }} | \
zstd -c > "{{ mayan_root_dir }}/backup/{{ mayan_db_name }}.sql.zst"
{% endif %}