Grive2

Grive2

Docker app from agusalex' Repository

Overview

Backup your files to Google Drive using Grive2 client in a docker container

Before you Start this Container:
Go to https://github.com/agusalex/grive2Docker/wiki/Setup and follow the setup guide

grive2Docker

Google Broke this integration, this docker image does not work anymore.

Docker Hub package

Docker Container for grive2 by vitalif

  • This will sync all Drive account's folders and files to a path specified
  • It can be configured to sync some folders only using grives parameters
  • It runs on schedule given by the crontab you can configure that in the CRON parameter.
  • This container's snapshot tag will be built automatically on docker hub every 1st of the month based on the master branch of grive2.

Environmental Variables

Variable Description
PARAMS Passes the parameters to grive2. see Grive Settings bellow
ID Your Google Client ID
SECRET Your Google Secret
CODE Your Google Code
CRON Cron Schedule
PERM Unix Permissions to set on all files in folder

Google Drive Setup

Running

  • Run this container with these ENV options :

docker run -it -e ID=CLIENT_ID -e SECRET=SECRET -v /your/host/folder:/drive agusalex/grive2

  • Go to the provided URL -> Grant Access then copy and paste the CODE when prompted in the terminal
  • It will start sync
  • Enjoy Grive2!!

Now you can run it without the environmental variables as these get saved into the folder, just run it like this so that it stays like a background process:

docker run -v /your/host/folder:/drive agusalex/grive2 

Optional

If you already have your response code you can use this (warning this will expose your credentials to anyone with access to the computer)

docker run -it -e ID=CLIENT_ID -e SECRET=SECRET -e CODE=CODE -v /your/host/folder:/drive agusalex/grive2 

You can always grab your response code by appending your ID to this URL:

https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=**FILL_HERE_YOUR_CLIENT_ID**

Grive Settings

For setting your own Grive configs for example syncing only one folder with -s you may use the PARAMS environmental variable as so:

docker run -it -v /your/host/folder:/drive -e PARAMS="-s folder_name" agusalex/grive2 
Parameter Description
-s your_folder Single subdirectory to sync (remembered for next runs)
--ignore regex Perl RegExp to ignore files (matched against relative paths, remembered for next runs).
--new-rev Create new revisions in server for updated files.
--force Force grive to always download a file from Google Drive instead of uploading it.
--dry-run Only detect which files need to be uploaded/downloaded, without actually performing them.
--upload-only do not download anything from Google Drive, only upload local changes.

For more info on Grive2, all docs can be found here https://yourcmc.ru/wiki/Grive2

Install Grive2 on Unraid in a few clicks.

Find Grive2 in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Grive2 Review the template variables and paths Click Install

Download Statistics

68,100
Total Downloads
9
This Month
48
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Details

Repository
agusalex/grive2
Last Updated2023-07-01
First Seen2020-09-25

Runtime arguments

Network
bridge
Shell
sh
Privileged
false

Template configuration

UNRAID_FOLDERPathrw

Path to the unraid folder in which to sync the files, it also will contain .grive config file

Target
/drive
CLIENT_IDVariable

Your Client ID obtained by doing the procedure in the description

Target
ID
SECRETVariable

Your Client Secret obtained by doing the procedure in the description

CODEVariable

Your client secret obtained from the URL in the description Delete me after the setup is complete

GRIVE_PARAMSVariable

Passes parameters to grive2. For example -s my_drive_folder. See https://github.com/agusalex/grive2docker#grive-settings

Target
PARAMS
CRONVariable

Crontab schedule to run this container, use this to generate it: https://crontab.guru/

PERMISSIONSVariable

The UNIX permissions to apply to all files in the folder after sync. This will override any permissions you already have.

Target
PERM