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.
30 lines
1.1 KiB
30 lines
1.1 KiB
3 years ago
|
#!/bin/sh
|
||
|
|
||
|
set -eo pipefail
|
||
4 years ago
|
|
||
4 years ago
|
{% if mayan_db_engine == 'mysql' %}
|
||
4 years ago
|
/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
|
||
4 years ago
|
{% else %}
|
||
3 years ago
|
PGPASSWORD={{ mayan_db_pass | quote }} /usr/pgsql-14/bin/pg_dump \
|
||
4 years ago
|
--clean \
|
||
3 years ago
|
--create \
|
||
4 years ago
|
--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 %}
|
||
4 years ago
|
|
||
|
# 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 }}
|
||
4 years ago
|
{{ mayan_root_dir }}/venv/bin/python {{ mayan_root_dir }}/venv/bin/mayan-edms.py mountindex --background {{ index }} {{ mayan_root_dir }}/fuse/{{ index }}
|
||
4 years ago
|
{% endfor %}
|
||
|
|