How to sync Google Drive on Linux with Docker
This is an quick and easy docker based solution to backup your data and sync it to the Google Drive.
It will be useful for small and medium on Linux hosted websites.
- Linux OS with Docker v17+
- Clone repository from Github anywhere to your server.
You will have two files: Dockerfile and run_google_divesync.sh
git clone https://github.com/oleh-v/Docker-Linux-sync-Google-Drive
- In console run
It runs following steps:
/Backup/GoogleDrive- Google Drive dir
/Backup/conf- configs and credentials to the googledrive account
- build of Docker Image
- first run of DriveSync script
Please watch out to the output in console:
DriveSync will ask open an long url in browser to grant access to your Google Drive. Copy this long url and open in browser, acceppt access, copy code-response and paste it back to the console.
Done! You have grant access and made first synchronization. All entry of
/Backup/GoogleDrive will be syncroniezed with Google Drive.
You can set cronjob to run
./run_google_divesync.sh every day. For example:
0 0 * * * /bin/sh /path_to_script/run_google_divesync.sh #divesync everyday at 00:00
What will be backed up to the
/Backup/GoogleDrive directory - on yours decision.
You can take example of "How to backup database" and "How to backup site" from next article.