Created
March 5, 2021 19:00
-
-
Save athphane/436014171e6161cab572426ef74d0320 to your computer and use it in GitHub Desktop.
Script used to take backup of Bitwarden and upload to cloud using rclone
This file contains hidden or 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 | |
echo "Running Bitwarden Backup Script" | |
echo "===============================" | |
export FOLDER_DATE=$(date +"%Y-%m-%d") | |
export DATE=$(date +"%Y-%m-%d-%H-%M-%S") | |
echo "The time is $DATE" | |
echo "===============================" | |
echo "Zipping Bitwarden Folder" | |
echo "===============================" | |
/usr/bin/zip -r /tmp/bitwarden-$DATE.zip /path-to/bitwarden/ | |
echo | |
echo "Uploading file to the cloud" | |
echo "===============================" | |
/usr/bin/rclone copy --config=/root/rclone.conf /tmp/bitwarden-$DATE.zip cloud-drive:bitwarden_backups/$FOLDER_DATE | |
echo "Deleting zip file from system" | |
rm /tmp/bitwarden*.zip | |
echo "Done" | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment