• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Automatically Backup Linux Server to Google Drive [CentOS7]

Titan

Well-known member
Jul 2, 2020
314
452
63
Space
watcha.movie
Hello, I thought I'd share with you how I automatically back up all my servers to my person Google Drive account, I've created a nice easy script for you to use which will install everything needed.

As always my resources are free my time is not, I also am a huge believer of if you can't do it then maybe you shouldn't but we all gotta learn right ?

Sections:

1) Prerequisites.
2) Downloading and running the script.

Section 1: Prerequisites:

You just need a Google Drive account as well as a CentOS7 dedicated machine or VPS. You'll need to manually download these two things to your server before hand.

Bash:
yum install dos2unix -y

Bash:
yum install curl -y

Section 2: Downloading and running the script.

Simply just follow the below commands this is basically a copy paste tutorial it's the Google Drive part which is my own.

Bash:
curl -O https://cdn.watcha.movie/google/google-drive-installer.sh

Bash:
chmod 777 google-drive-installer.sh

Bash:
dos2unix google-drive-installer.sh

Bash:
./google-drive-installer.sh

Let it do it's thing when prompted at the end, click the link it will look something like this:

Code:
https://accounts.google.com/o/oauth2/auth?client_id=123456789123-7n0vf****

Then authorize the app to access your Google Drive, the app is created by me, yes it's not verified (as of typing) as it takes a few days.

Section 4: GDrive commands to write your own Cron jobs:

All GDrive commands can be found by running the following gdrive list however I'll list some of the ones I use when writing my own cron jobs.

I use this one to zip up and automatically upload my sites to google drive on a daily basis. What it does is it zips up my directory and the uploads the file after zipping before deleting it automatically to prevent people from downloading it.

backup.sh

Bash:
zip -r /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip /home/SITE/public_html

/usr/sbin/gdrive upload --parent FOLDER_ID /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip

rm /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip

Please note when doing any gdrive bash commands to do them via the string /usr/sbin/gdrive otherwise sometimes it doesn't recognize it.

I can install this for you, however my fee for this is $30 as it's a longer one and requires a lot of co-operation from you.
 
Last edited:
  • Like
Reactions: trieubui and pitza
Hello, I thought I'd share with you how I automatically back up all my servers to Google Drive. This tutorial will be in a few sections for you to follow and a lot of the installation is automated so should be easy enough. I'll be eventually converting this script to work on Ubuntu systems as well as other Linux OS's however it takes time I'll be updating this thread with instructions for those when I've done them.

As always my resources are free my time is not, I also am a huge believer of if you can't do it then maybe you shouldn't but we all gotta learn right ?

Sections:

1) Prerequisites
2) Installing GO onto your CentOS7 machine
3) Installing GDrive Script on your CentOS7 machine
4) GDrive commands to write your own Cron jobs

Section 1: Prerequisites:

You need a VPS or Dedicated server running CentOS7 X64
You also need a Google Drive account, can be of any kind, so long as your site size doesn't exceed your Google Drive Storage
You also need nano installing to install GO easily as I personally don't like vim

Section 2: Installing GO onto your CentOS7 machine:

Simply just follow the below commands this is basically a copy paste tutorial it's the Google Drive part which is my own.

Bash:
yum install nano -y

Bash:
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz

Bash:
sudo tar -C /usr/local -xf go1.13.5.linux-amd64.tar.gz

This bit you need to do yourself, enter the below command...

Bash:
sudo nano ~/.bash_profile

...then add the following lines...

Bash:
export GOPATH=$HOME/golang
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

...then CTRL + X followed by Y to save, then onto more commands.

Bash:
source ~/.bash_profile

Now go should be installed you can check by putting the following command...

Bash:
go version

...and that should return the GO version.

Section 3: Installing GDrive Script on your CentOS7 machine:

This is a bash script I have created, you just need to get the bash script and it will run it's self and install on your machine. You can download the bash script yourself if you want to verify it for backdoors etc.

To get the bash script run the following...

Bash:
wget https://cdn.ineeda.org/google-drive-installer.sh

...then run the following command to run the bash script.

Bash:
./google-drive-installer.sh

Let it do it's thing when prompted at the end, click the link it will look something like this:

Code:
https://accounts.google.com/o/oauth2/auth?client_id=123456789123-7n0vf****

Then authorize the app to access your Google Drive, the app is created by me, yes it's not verified (as of typing) as it takes a few days.

Section 4: GDrive commands to write your own Cron jobs:

All GDrive commands can be found by running the following gdrive list however I'll list some of the ones I use when writing my own cron jobs.

I use this one to zip up and automatically upload my sites to google drive on a daily basis. What it does is it zips up my directory and the uploads the file after zipping before deleting it automatically to prevent people from downloading it.

backup.sh

Bash:
zip -r /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip /home/SITE/public_html

/usr/sbin/gdrive upload --parent FOLDER_ID /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip

rm /home/SITE/public_html/backup-$(date +"%Y-%m-%d").zip

Please note when doing any gdrive bash commands to do them via the string /usr/sbin/gdrive otherwise sometimes it doesn't recognize it.

I can install this for you, however my fee for this is $30 as it's a longer one and requires a lot of co-operation from you.

What is the content of google-drive-installer.sh exactly?
It seems the domain already expired
 
What is the content of google-drive-installer.sh exactly?
It seems the domain already expired

I've cancelled my hosting for this domain I need to reorganise my website stuff... it was the installer script to skip a few steps of a different tutorial.

I'll fix this early next month as well as my downloads etc, if you need to know ASAP then just PM me.
 
  • Like
Reactions: xmasada
I've cancelled my hosting for this domain I need to reorganise my website stuff... it was the installer script to skip a few steps of a different tutorial.

I'll fix this early next month as well as my downloads etc, if you need to know ASAP then just PM me.
alright then.
thanks for the information
 
I've fixed the CDN link and I've updated this with a new .sh file which does 99% of it all for you, you just need to do a few things to get it going.
 
  • Like
Reactions: xmasada
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock