mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-06 16:46:54 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
16
roles/sftpgo/templates/pre-backup.j2
Normal file
16
roles/sftpgo/templates/pre-backup.j2
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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/
|
Reference in New Issue
Block a user