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 with the following code in /home/backup/ directory

Now Add it on Corn Job to run it automatically
echo "0 2 * * * root /home/backup/ >> /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

Jana is the founder of Tech4bros. CS Engineer ,Part time Blogger and Web Developer, Crypto Trader and Investor.