#!/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 %}