How to Backup your Linux Server with Google Drive (Step 2 of 3) [Installing Grive]

posted in: Linux | 1

GRIVEWelcome back! Hopefully you have already read my previous post.  Now that you have local backups automatically running on your Linux server, we need to get those files synced to Google Drive.  I am going to explain the step where I pull all my backup files to a backup server.  If this is unnecessary for your needs, feel free to skip to installing Grive on your Linux Server.

On my dedicated backup VPS I have a script that runs hourly to pull down backups and sync with Google Drive.  This server is nice to have separated from the other web servers in my environment because I want to practice “best practice”.  Right now I just have a friend of mine that I am managing a Linux server for, but I would like to be in a position where I can support others without additional configuration.  When you install Grive you will understand why I did it this way.  If you install Grive on a per server basis, each server will have a copy of all backups.  With one dedicated server, you limit the amount of copies.  This improves security and is just an overall cleaner install.

So lets install Grive:

My backup server is 64bit Ubuntu 12.04.  At this point 64 might be the only supported OS.

If you are using Ubuntu 12.04 you will need to run this command:
This step can likely be skipped on newer versions of Ubuntu Server

sudo apt-get update && sudo apt-get install python-software-properties

Once that is installed you will be able to install this reposiltory:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive

So now you have Grive installed.  We need to create a directory for Grive to work in.

mkdir ~/google_drive
cd ~/google_drive
grive -a

The command you just ran will eventually provide you with a URL to Authenticate with your Google account.  Copy that URL into your Broswer, then allow Grive to access your account.

Grive should begin to sync the files in your Google Drive account.  Now, you understand why you may not want this on your web server.

So now you have Grive installed, authenticated, and syncing with your Google Drive account.  The last step is configuring another script to automate syncs as well as pull them down form your various servers.

Please check that out in my next post.

One Response

  1. […] Part 3 – Remote Backup Script […]

Leave a Reply