Coding How To Network

How to backup VestaCP files to Google Drive automatically Centos 6,7

Written by Jana Raj

Recently, I got an issue with my website backups so I moved my website Into a fresh VPS with VestaCP and started researching how to upload VestaCP backups to my cloud drives to keep them safe and I found a solution to backup vestacp files to Google drive automatically.

Currently im running VestaCP in Centos 6 but this tutorial may work in all Centos Versions.

How to backup VestaCP files to Google Drive automatically

Install Gdrive

We have to install a third-party CLI tool which lets you simply transfer files to your Google Drive with scripts.

This is a tool to upload files using OAuth2, this does not sync.

Now type drive

It will ask for verification code like this :

Now we have created link between our server and Google Drive. Now we can upload our files to Google drive.

Backup Script

Now create a file tech4bros.sh with the following code in /home/backup/ directory

Now Add it on Corn Job to run it automatically
echo "0 2 * * * root /home/backup/tech4bros.sh >> /etc/crontab

Now the cornjob runs it daily on 2AM.

If you have modifications or problem in using it, share it on the common section below.

 

 

About the author

Jana Raj

Janarthanan is the founder and Chief Editor of Tech4bros .He is a Student of Computer Science and Engineering ,a full time Geek, part time Blogger and Quarter time Coder. He loves Blogging, Web Designing and making new friends . Google Plus