Titan
Well-known member
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.
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.
Let it do it's thing when prompted at the end, click the link it will look something like this:
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
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.
Please note when doing any gdrive bash commands to do them via the string
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.
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: