mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-04 15:47:32 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
29
roles/unmaintained/mayan_edms/templates/pre_backup.sh.j2
Normal file
29
roles/unmaintained/mayan_edms/templates/pre_backup.sh.j2
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
{% 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 | quote }} /usr/pgsql-14/bin/pg_dump \
|
||||
--clean \
|
||||
--create \
|
||||
--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 %}
|
||||
|
||||
# Use FUSE to export indexes as a file tree
|
||||
set -o allexport
|
||||
. /opt/mayan-edms/config/.env
|
||||
set +o allexport
|
||||
{% for index in mayan_index_as_fuse %}
|
||||
mkdir -p {{ mayan_root_dir }}/fuse/{{ index }}
|
||||
{{ mayan_root_dir }}/venv/bin/python {{ mayan_root_dir }}/venv/bin/mayan-edms.py mountindex --background {{ index }} {{ mayan_root_dir }}/fuse/{{ index }}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user