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.
19 lines
602 B
19 lines
602 B
#!/bin/sh
|
|
|
|
set -eo pipefail
|
|
|
|
{% if cs_lapi_enabled %}
|
|
{% if cs_db_engine == 'mysql' %}
|
|
/usr/bin/mysqldump \
|
|
{% if cs_db_server not in ['localhost','127.0.0.1'] %}
|
|
--user={{ cs_db_user | quote }} \
|
|
--password={{ cs_db_pass | quote }} \
|
|
--host={{ cs_db_server | quote }} \
|
|
--port={{ cs_db_port | quote }} \
|
|
{% endif %}
|
|
--quick --single-transaction \
|
|
--add-drop-table {{ cs_db_name | quote }} | zstd -c > {{ cs_root_dir }}/backup/{{ cs_db_name }}.sql.zst
|
|
{% else %}
|
|
sqlite3 {{ cs_root_dir }}/data/crowdsec.db .dump | zstd -c > {{ cs_root_dir }}/backup/crowdsec.sql.zst
|
|
{% endif %}
|
|
{% endif %}
|
|
|