Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
22 lines
620 B
Bash
22 lines
620 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Allow use of !() when copying to not copy certain files
|
|
shopt -s extglob
|
|
|
|
# Based on: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
|
|
if [ ! -d "$BACKUP_FOLDER" ]; then
|
|
echo "Backup folder '$BACKUP_FOLDER' does not exist" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -f "$DATA_FOLDER"/db.sqlite3 ]]; then
|
|
sqlite3 "$DATA_FOLDER"/db.sqlite3 ".backup '$BACKUP_FOLDER/db.sqlite3'"
|
|
fi
|
|
|
|
if [ ! -d "$DATA_FOLDER" ]; then
|
|
echo "No data folder (yet). This will happen on first launch if backup is triggered before vaultwarden has started."
|
|
exit 0
|
|
fi
|
|
|
|
cp -r "$DATA_FOLDER"/!(db.*) "$BACKUP_FOLDER"/
|