#!/bin/sh
set -eo pipefail

/usr/bin/mysqldump \
{% if kimai_db_server not in ['localhost','127.0.0.1'] %}
  --user={{ kimai_db_user | quote }} \
  --password={{ kimai_db_pass | quote }} \
  --host={{ kimai_db_server | quote }} \
  --port={{ kimai_db_port | quote }} \
{% endif %}
  --quick --single-transaction \
  --add-drop-table {{ kimai_db_name | quote }} | zstd -c > {{ kimai_root_dir }}/backup/{{ kimai_db_name }}.sql.zst

