Ansible roles
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
663 B

#!/bin/bash -e
mkdir -p /home/lbkp/crowdsec/
{% if crowdsec_lapi_enabled %}
{% if crowdsec_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if crowdsec_db_server not in ['localhost','127.0.0.1'] %}
--user={{ crowdsec_db_user | quote }} \
--password={{ crowdsec_db_pass | quote }} \
--host={{ crowdsec_db_server | quote }} \
--port={{ crowdsec_db_port | quote }} \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ crowdsec_db_name | quote }} | zstd -c > /home/lbkp/crowdsec/{{ crowdsec_db_name }}.sql.zst
{% else %}
sqlite3 /var/lib/crowdsec/data/crowdsec.db .dump | zstd -c > /home/lbkp/crowdsec/crowdsec.sql.zst
{% endif %}
{% endif %}