mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-16 10:13:26 +02:00
17 lines
497 B
Django/Jinja
17 lines
497 B
Django/Jinja
#!/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/
|