Files
bitwardenbackup/README.md

1.8 KiB

Bitwarden Backup

This project uses bw cli, gpg, and sdelete/srm. It will export the vault and any organizations to both json and csv files. It also downloads all attachments into folders. You can zip the export together or gpg encrypt the export as well, the encryption is symmetric and uses your bitwarden vault password.

Usage

usage: bitwardenBackup.py [options]

Run Bitwarden backup operation. This will produce an encrypted zip/tar with exported CSV, JSON, and attachements.

options:
  -h, --help            show this help message and exit
  -a ACCOUNTS_TO_BACKUP [ACCOUNTS_TO_BACKUP ...], --accounts ACCOUNTS_TO_BACKUP [ACCOUNTS_TO_BACKUP ...]
                        Accounts to backup instead of all accounts.
  -c, --config          Edit Bitwarden account configuration.
  -t, --test            Test Bitwarden account login and unlock.
  -v, --verbose         Output debug/verbose info to the console for troubleshooting.
  --no-encryption       Will only zip up export and will NOT encrypt anything.

Example crontab

# Command to run everything at 22:00 (10PM) on the 2nd and 17th of the month.  Will backup all configured bitwarden accounts and upload to seafile
 20 2,17 * * /usr/bin/apt update; /usr/bin/apt upgrade -y; /usr/bin/wget -O /tmp/bw.zip "https://vault.bitwarden.com/download/?app=cli&platform=linux"; /usr/bin/unzip -o -d /tmp/ /tmp/bw.zip; /usr/bin/chmod +x /tmp/bw; /usr/bin/mv /tmp/bw /usr/bin/bw; /usr/bin/python3 /opt/bitwardenbackup/bitwardenBackup.py; /usr/bin/curl https://rclone.org/install.sh | bash; /usr/bin/rclone move /opt/bitwardenbackup/exports seafile: --include "*.gpg"; /sbin/shutdown -P now

Example Rclone config file

[seafile]
type = webdav
url = https://gaunt.cloud/seafdav/Bitwarden%20Backups/
vendor = other
user = bitwardenbackup@gaunt.cloud
pass = *****