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
497 B

#!/bin/bash
set -eo pipefail
/usr/bin/mysqldump \
{% if sftpgo_db_server not in ['localhost', '127.0.0.1'] %}
--user={{ sftpgo_db_user | quote }} \
--password={{ sftpgo_db_pass | quote }} \
--host={{ sftpgo_db_server | quote }} \
--port={{ sftpgo_db_port }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ sftpgo_db_name }} | \
zstd -c > {{ sftpgo_root_dir }}/backup/{{ sftpgo_db_name }}.sql.zst
cp -a {{ sftpgo_root_dir }}/etc/id_* {{ sftpgo_root_dir }}/backup/