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