Article directory
Recently, a friend in online marketing had a problem with his WordPress website backup, so he moved the website to a new VPS and installed the VestaCP control 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 to automatically backup VestaCP files to Google Drive?

Many users are currently running VestaCP on CentOS 6 or CentOS 7, but this tutorial may be applicable 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 ask for the following verification code ▼
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▼
Hopefully, the article "How to automatically back up VestaCP files to Gdrive on CentOS 6/7?" shared on Chen Weiliang's blog ( https://www.chenweiliang.com/ ) will be helpful to you.
Feel free to share this article's link: https://www.chenweiliang.com/cwl-1110.html



