From 3cf79933536c1f15323ff17facefda2a0c7f630f Mon Sep 17 00:00:00 2001 From: tanshu Date: Sat, 25 Nov 2017 06:40:28 +0000 Subject: [PATCH] (Grav GitSync) Automatic Commit from tanshu --- pages/06.bitwarden/docs.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pages/06.bitwarden/docs.md b/pages/06.bitwarden/docs.md index 63b29ae..446d8ff 100644 --- a/pages/06.bitwarden/docs.md +++ b/pages/06.bitwarden/docs.md @@ -48,5 +48,19 @@ $HOME/webapps/warden/bin/start */20 * * * * ~/webapps/warden/bin/start ``` ### 4. Backup your database -4.1 Install gdrive to backup the database to google account in case of data loss at webfaction -Go to `https://github.com/prasmussen/gdrive` and download `gdrive-linux-x64` in `~/bin/` \ No newline at end of file +#### Install gdrive +Install gdrive to backup the database to google account in case of data loss at webfaction +Go to `https://github.com/prasmussen/gdrive` and download `gdrive-linux-x64` in `~/bin/` +```sh +wget -o ~/bin/gdrive $URL_FOR_GDRIVE_LINUX_X64_BINARY +``` +Make it executable `chmod +x ~/bin/gdrive` +#### Configure Google Drive +Link your gdrive to the account by running `gdrive list` and following the instructions +Create a folder called `Bitwarden` and get its id by running `gdrive list`. +Upload using `gdrive upload --parent $FOLDER_ID --name production_$(date +%F-%H:%M).sqlite3 ~/webapps/warden/db/production.sqlite3` +#### Automate Backups +Edit crontab using `export VISUAL=nano; crontab -e` and add the following line +```sh +0 1 * * * gdrive upload --parent $FOLDER_ID --name production_$(date +%F-%H:%M).sqlite3 ~/webapps/warden/db/production.sqlite3 +```