How to sync Google Drive on Linux with Docker

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.

Technologies used:

System Requirements:

  • Linux OS with Docker v17+

Usage:

  • Clone repository from Github anywhere to your server.
    git clone https://github.com/oleh-v/Docker-Linux-sync-Google-Drive
    You will have two files: Dockerfile and run_google_divesync.sh
  • In console run ./run_google_divesync.sh
    It runs following steps:
    • create /Backup/GoogleDrive - Google Drive dir
    • create /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.

Comments (0)

No comments at this moment

New comment

Articles

Visit our blog

On sale