aboutsummaryrefslogtreecommitdiff
path: root/bup-vw-db.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bup-vw-db.sh')
-rwxr-xr-xbup-vw-db.sh26
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}"
bgstack15