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:
18
roles/seafile/templates/pre-backup.sh.j2
Normal file
18
roles/seafile/templates/pre-backup.sh.j2
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
# Dump Databases
|
||||
for DB in {{ seafile_db_ccnet }} {{ seafile_db_seafile }} {{ seafile_db_seahub }}; do
|
||||
/usr/bin/mysqldump \
|
||||
--quick --single-transaction \
|
||||
{% if seafile_db_server not in ['127.0.0.1', 'localhost'] %}
|
||||
--user={{ seafile_db_user }} \
|
||||
--password={{ seafile_db_pass | quote }} \
|
||||
--host={{ seafile_db_server }} \
|
||||
{% endif %}
|
||||
--add-drop-table $DB | zstd -T0 -c > {{ seafile_root_dir }}/backup/$DB.sql.zst
|
||||
done
|
||||
|
||||
# Mount fuse FS
|
||||
{{ seafile_root_dir }}/seafile-server/seaf-fuse.sh start {{ seafile_root_dir }}/fuse/
|
Reference in New Issue
Block a user