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
9 if [[ ! -f "$DATA_FOLDER"/db.sqlite3
]]; then
10 echo "Could not find SQLite database file '$DATA_FOLDER/db.sqlite3'" >&2
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"