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.
 
 
 
 
 
 

18 lines
721 B

#!/bin/sh
set -eo pipefail
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 not in ['localhost', '127.0.0.1'] %}
--user={{ vaultwarden_db_user }} \
--password={{ vaultwarden_db_pass | quote }} \
--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 %}