No description
  • Python 81.9%
  • PowerShell 18.1%
Find a file
2026-03-12 20:10:44 +00:00
conf added conf dir with client pykmip sample file 2022-09-06 20:41:47 -04:00
.gitignore added working and export directory 2022-09-13 22:25:02 -04:00
bitwardenBackup.ps1 removed shorthand command aliases 2022-06-06 20:38:52 -04:00
bitwardenBackup.py Updated to delete age passphrase environment variable if it exists 2026-03-12 20:10:44 +00:00
README.md Updated the help options and explained the crontab command. Updated crontab to use apt-get 2026-03-10 19:45:29 +00:00
requirements.txt removed secure_delete 2022-12-30 17:18:05 -05:00

Bitwarden Backup

This project uses bw cli, gpg/age, 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/age encrypt the export as well, the encryption is symmetric and uses your bitwarden vault password.

Usage

usage: bitwardenBackup.py [options]

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

options:
  -h, --help            show this help message and exit
  -a, --accounts ACCOUNTS_TO_BACKUP [ACCOUNTS_TO_BACKUP ...]
                        Accounts to backup instead of all accounts.
  --age                 Use AGE instead of GPG encryption.
  -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.
# This will update the system, install the latest bw cli and rclone
# After the backup, the encrypted files are moved to my cloud storage.
# If using AGE encryption, you will want to update the --include to *.age
20 2,17 * * /usr/bin/apt-get update; /usr/bin/apt-get 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 cloud: --include "*.gpg"; /sbin/shutdown -P now

Example Rclone config file

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