How does Centos6/7 automatically backup VestaCP files to Gdrive network disk?

Recently, there isInternet marketingfriend'sWordpressThere was a problem with the website backup, so he moved the website to a new VPS and installedVestaCPcontrol panel.

  • He then started researching how to upload VestaCP backups to Google Drive to keep them safe.
  • Finally, found a solution to automatically backup VestaCP files to Google Drive.

How does Centos6/7 automatically backup VestaCP files to Gdrive network disk?

How to automatically backup VestaCP files to Google Drive?

VestaCP control panel LOGO 2nd sheet

There are many friends inCentos 6 or Centos7 running VestaCP, but this tutorial may apply to all Centos versions.

Step 1: Install Gdrive network disk

We had to install a XNUMXrd party CLI tool, you just need to use a script to transfer files to Google Drive.

wget -O drive https://drive.google.com/uc?id=0B3X9GlR6EmbnMHBMVWtKaEZXdDg

mv drive /usr/sbin/drive

chmod 755 /usr/sbin/drive
  • This is a tool to upload files using OAuth2, this will not sync.

Now enter the following command ▼

drive

it will askVerification codeas follows ▼

Go to the following link in your browser: 
https://accounts.google.com/o/oauth2/auth?client_id=123456789123-7n0vf5akeru7on6o2fjinrecpdoe99eg.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=state
  • Now we have a link between the server and Google Drive.
  • We are ready to upload the file to Google Drive.

Step 2: Upload Gdrive Auto Backup Script File

1) in /home/backup/directory, create a file containing the following code auto-back-gdrive.shfile▼

drive upload --file "admin.$(date '+%Y-%m-%d').tar"

2) Next, add it to the Corn Job timed task to run it automatically▼

echo "0 2 * * * /home/backup/auto-back-gdrive.sh >> /etc/crontab
  • Now, the Corn Job cron job runs every day at 2am.

Attention points

This app has been blocked
  • This app is trying to access sensitive information in your Google Account.To keep your account safe, Google blocked this access.

For the solution, please click the following link to view the VPS using GDrive automatic synchronization tutorial▼

Here are more tutorials on automatic website backup▼

Comment

Your email address will not be published. Required fields * Callout

Scroll to Top