-
-
Save akash07k/55bfb80be6e61083ce02e3a495ce67cd to your computer and use it in GitHub Desktop.
Bash script to zip up Vaultwarden data directory and upload to Cloud storage.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#edit these to your config | |
BWDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | |
DATETIME="$(date +'%Y-%m-%d_%H-%M-%S')" | |
FOLDERPATH="$(date +'%Y-%m-%d')" | |
GZFILE=bitwarden-${DATETIME}.tar.gz | |
#change working dir to /tmp | |
cd /tmp/ | |
# Compress Vaultwarden directory to gzfile | |
tar -Pczf $GZFILE $BWDIR | |
# Copy the file to an Rclone storage endpoint | |
rclone copy $GZFILE MyGoogleDrive:/bitwarden_backups/${FOLDERPATH}/ | |
#remove temp file | |
rm $GZFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment