python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / modules / services / security / vaultwarden / backup.sh
blob2a3de0ab1deeb5138d232c5910fdf7780e1fd9a1
1 #!/usr/bin/env bash
3 # Based on: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
4 if ! mkdir -p "$BACKUP_FOLDER"; then
5 echo "Could not create backup folder '$BACKUP_FOLDER'" >&2
6 exit 1
7 fi
9 if [[ ! -f "$DATA_FOLDER"/db.sqlite3 ]]; then
10 echo "Could not find SQLite database file '$DATA_FOLDER/db.sqlite3'" >&2
11 exit 1
14 sqlite3 "$DATA_FOLDER"/db.sqlite3 ".backup '$BACKUP_FOLDER/db.sqlite3'"
15 cp "$DATA_FOLDER"/rsa_key.{der,pem,pub.der} "$BACKUP_FOLDER"
16 cp -r "$DATA_FOLDER"/attachments "$BACKUP_FOLDER"
17 cp -r "$DATA_FOLDER"/icon_cache "$BACKUP_FOLDER"