Backup Web Server dan Database ke Google Drive


 1- Create a Script or Download   CLICK 
[root@linux011 ~]# vim backup_script.sh



2- Set Permission   
2- Run Script
 [root@linux011 ~]#  ./ backup_script.sh
https://docs.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA&export=download
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/x-executable] Saving to: “/usr/bin/gdrive”
[                             <=>                                    ] 3,506,980   49.9K/s
2017-11-02 09:45:37 (63.3 KB/s) – “/usr/bin/gdrive” saved [7805504]
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=367116221053-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
Enter verification code:
Copy the above url and open web browser- and login to your gmail account…
 

Allow Gdrive

Copy this code and paste Linux terminal and press enter

Enter verification code: 4/py5er42W-v-8wGNr8krnf9dSulvT6Rjh6blhvA
Backup Process Starting…………………..
Directory 1vX23Rm4JafhgjtbkiRLRHxLScNroyr7 created
Directory 1sbWO9ruAnS2BHrRkeIu7P3XtRHvoMN created
Uploading /tmp/Web_Server_Backup/www/2017-11-02-www.tar.gz
Uploaded 1QAow3L_ALWUmvdGpzWSg8YK9Kjtsf at 50.8 KB/s, total 26.8 MB
Removed /tmp/Web_Server_Backup/www/2017-11-02-www.tar.gz
Uploading /tmp/Web_Server_Backup/www/2017-11-02-www.sql.gz
Uploaded 1a6yYn6Z55to_-bGwRX4kCTTVvnp4Xp at 89.9 KB/s, total 14.1 MB
Removed /tmp/Web_Server_Backup/www/2017-11-02-www.sql.gz

Successfully Done……

Verify Backup Complete or Not 
1- Check Your Mail – Backup Log
2- Google Dive


Now add the script as a cronjob so it runs every day
[root@linux011 ~]#  crontab –e
@daily   /bin/bash       /root/backup_script.sh         # Run Script Daily

Now your Web Server & Database backups will automatically be uploaded to Google Drive…..

0 Response to "Backup Web Server dan Database ke Google Drive"