(Grav GitSync) Automatic Commit from tanshu

This commit is contained in:
tanshu 2017-11-25 06:40:28 +00:00 committed by GitSync
parent c0b92956a2
commit 3cf7993353
1 changed files with 16 additions and 2 deletions

View File

@ -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/`
#### 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
```