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.
18 lines
609 B
18 lines
609 B
#!/bin/bash -e
|
|
|
|
mkdir -p /home/lbkp/crowdsec/
|
|
{% 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 > /home/lbkp/crowdsec/{{ cs_db_name }}.sql.zst
|
|
{% else %}
|
|
sqlite3 /var/lib/crowdsec/data/crowdsec.db .dump | zstd -c > /home/lbkp/crowdsec/crowdsec.sql.zst
|
|
{% endif %}
|
|
{% endif %}
|
|
|