diff options
author | B. Stack <bgstack15@gmail.com> | 2023-01-02 23:04:19 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2023-01-02 23:04:19 -0500 |
commit | f1fddca929f1bf9d924f25b671f38dacea4ca382 (patch) | |
tree | 576f2b3eb4093cd19ab98211bad6856ed1acf2f2 /bup-vw-db.sh | |
download | bup-vaultwarden-f1fddca929f1bf9d924f25b671f38dacea4ca382.tar.gz bup-vaultwarden-f1fddca929f1bf9d924f25b671f38dacea4ca382.tar.bz2 bup-vaultwarden-f1fddca929f1bf9d924f25b671f38dacea4ca382.zip |
Diffstat (limited to 'bup-vw-db.sh')
-rwxr-xr-x | bup-vw-db.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bup-vw-db.sh b/bup-vw-db.sh new file mode 100755 index 0000000..904f09b --- /dev/null +++ b/bup-vw-db.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# File: vm4:/home/vaultwarden/bup-vw-db.sh +# Location: vm4 +# Author: bgstack15 +# Startdate: 2023-01-02-2 16:54 +# Title: Bup Vaultwarden database +# Project: bup-vw +# Purpose: Backup Vaultwarden database +# History: +# Usage: called by bup-vw.sh +# Reference: +# https://github.com/dani-garcia/vaultwarden/wiki/General-%28not-docker%29 +# https://stackoverflow.com/questions/25675314/how-to-backup-sqlite-database/25684912#25684912 +# Improve: +# Dependencies: +# sqlite3 +# must run as root! +# Documentation: see bup-vw.sh +INDB=/home/vaultwarden/vw/bitwarden/db.sqlite3 +test -z "${LOCALOUTDIR}" && LOCALOUTDIR=/home/vaultwarden/bup +test -z "${OUTFILE}" && OUTFILE="${LOCALOUTDIR}/vw.$( date "+%F" ).sq3" +echo ".backup ${OUTFILE}" | sqlite3 "${INDB}" +# the main script will tarball it with the relevant files +#gzip "${OUTFILE}" +chown vaultwarden:vaultwarden "${OUTFILE}" +echo "${OUTFILE}" |