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.

17 lines
721 B

#!/bin/bash -e
mkdir -p /home/lbkp/vaultwarden/
cp {{ vaultwarden_root_dir }}/data/rsa* {{ vaultwarden_root_dir }}/backup/
{% if vaultwarden_db_engine == 'mysql' %}
/usr/bin/mysqldump \
{% if vaultwarden_db_server != 'localhost' and vaultwarden_db_server != '127.0.0.1' %}
--user='{{ vaultwarden_db_user }}' \
--password='{{ vaultwarden_db_pass }}' \
--host='{{ vaultwarden_db_server }}' \
{% endif %}
--quick --single-transaction \
--add-drop-table {{ vaultwarden_db_name }} | zstd -c > {{ vaultwarden_root_dir }}/backup/{{ vaultwarden_db_name }}.sql.zst
{% else %}
sqlite3 {{ vaultwarden_root_dir }}/data/db.sqlite3 ".backup '{{ vaultwarden_root_dir }}/backup/db.sqlite3'"
{% endif %}