3 # Allow use of !() when copying to not copy certain files
6 # Based on: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
7 if [ ! -d "$BACKUP_FOLDER" ]; then
8 echo "Backup folder '$BACKUP_FOLDER' does not exist" >&2
12 if [[ -f "$DATA_FOLDER"/db.sqlite3
]]; then
13 sqlite3
"$DATA_FOLDER"/db.sqlite3
".backup '$BACKUP_FOLDER/db.sqlite3'"
16 if [ ! -d "$DATA_FOLDER" ]; then
17 echo "No data folder (yet). This will happen on first launch if backup is triggered before vaultwarden has started."
21 cp -r "$DATA_FOLDER"/!(db.
*) "$BACKUP_FOLDER"/