[Support] agusalex - Grive2


agusalex

Recommended Posts

Overview: Support for Docker image grive2

Application Name: Grive2

Application Site: https://github.com/vitalif/grive2

Docker Hub: https://hub.docker.com/repository/docker/agusalex/grive2

Github Docker: https://github.com/agusalex/grive2Docker

Templates Repo: https://github.com/agusalex/docker-templates

 

Backup your files to Google Drive using Grive2 client (by vitalif) in a docker container

This app aims to make it easier to sync a folder from Google Drive to an Unraid folder

 

Some Notes:

  • By default it will sync all your Drive account's folders and files to a path specified
  • It can be configured to sync one folder only (using grive2 parameter -s drive_folder)
    • like so GRIVE_PARAMS: -s drive_folder
  • Based on Alpine Linux, its size is very small <70mb per instance !!
  • This container's snapshot tag will be built automatically on docker hub every 1st of the month based on the master branch of grive2.
  • Tag latest will be used for stable release

 

Before you Start this Container:

Follow the https://github.com/agusalex/grive2Docker/wiki/Setup Setup guide

 

For more info go to: 

 

https://github.com/agusalex/grive2Docker REPO

Edited by agusalex
Link to comment
On 9/26/2020 at 12:27 PM, mattybeens said:

It seems if you use an SMB share, any download files from google drive do not have read permissions after they have been downloaded.

Weird, I tried replicating that. Set an SMB share to private and synced a folder inside the share to a drive folder of the same name and it worked. How did you arrive at that conclusion?  Can you give us your Docker container's log output ? also it would help if you try running this inside the folder you are trying to sync and post it here to check permissions.

I dont know what I tried but tested it again today and could confirm your issue. I added it as an issue to github will be dealing with that soon.

 

Edited by agusalex
Link to comment

Sorry, what i mean is when i look at the log file, from the unraid dashboard (picture attached) there is no time/ date of when specific actions took place.

 

In the image attached there is an error highlighted in red - it would useful to see what time/ date this was so i could narrow down what possibly caused it. 

 

it would be also helpful to see when certain files were started uploading to see how long they took to upload. 

 

Thanks

 

image.png.265def9bb821f8e428f11d32fffce292.png

Link to comment
  • 1 month later...

Love this docker!!!  Precisely what I needed in life!

 

For the life of me, I can't figure out how to make it sync a subfolder with a space in the filename.  Grrr.  I have tried quotes around the subfolder, and a "\" without quotes, but nothing works.  Anyway, that's just a niggle.  Thanks for this awesomeness!

  • Thanks 1
Link to comment
12 hours ago, akshunj said:

Love this docker!!!  Precisely what I needed in life!

 

For the life of me, I can't figure out how to make it sync a subfolder with a space in the filename.  Grrr.  I have tried quotes around the subfolder, and a "\" without quotes, but nothing works.  Anyway, that's just a niggle.  Thanks for this awesomeness!

I'm really glad you are enjoying it! I've searched through the docs and couldn't find an answer either, there is a similar issue on github https://github.com/vitalif/grive2/issues/284.

  • Like 1
Link to comment

So for some reason after restarting the docker to remove the CODE, I can't get it to detect changes in the UNRAID folder.  It did the initial sync fine, however when i added a folder and some text documents to test it's not syncing those.

 

Any ideas?

 

Disregard Figured it out, was my own stupidity.

Edited by DeadChimi
  • Haha 1
Link to comment
  • 2 weeks later...

I'm having issues with syncing specific folder, stuck at 'Reading remote server file list', running the grive with -d manually via console shows reading across the whole gdrive (which would take forever). Any ideas?

 

UPDATE: Nvm, switching to rclone instead..

Edited by dziewuliz
Link to comment
  • 3 weeks later...
On 12/3/2020 at 1:32 AM, dziewuliz said:

I'm having issues with syncing specific folder, stuck at 'Reading remote server file list', running the grive with -d manually via console shows reading across the whole gdrive (which would take forever). Any ideas?

 

UPDATE: Nvm, switching to rclone instead..

I'm sorry for the delay this has been a hell of a year for me (and I guess everyone to some degree) I'm afraid thats one of the limitations of Grive2, it takes forever because it scans every file before starting. To mitigate this I suggest only syncing a certain folder using -s but I know this does not work for every use case. 

Link to comment
On 12/22/2020 at 2:18 PM, Archemedees said:

Is there a parameter I can set to only upload files? IE i want to put files into the share, have them uploaded to gdrive then I can delete the files from the share and they are not redownloaded or delete from gdrive? 

Hi, I don't think such parameter exists, the closest you can use is -f which makes it so that it always downloads the file from drive overwriting local changes. The problem is that if you delete them they will be re-downloaded. You could make a script that deletes those files and then adds their filenames to a file named ".griveignore" on the folder you want to sync. That will make it so that they are not re-downloaded. 

 

Haven't tried that but I think it should work

 

Edited by agusalex
Link to comment
  • 1 month later...
  • 4 weeks later...

I gave your recent snapshot a try, but the read permission issue still persists.  I also cross posted on GitHub.  I hope just changing the Repository setting to add :snapshot to the end was enough to get what it needed (it seemed to trigger a new download) I will say that if the files are first created locally, then synced, the issue does not present itself.  It is only a problem if Google Drive has the file and it is newly written to disk.  If you get this figured out, I see it as set it and forget it.  Appreciate what you have done to get it here and easily available to everyone.  I wish I knew more about how all this gets setup, because I would help, but I'm not familiar with all the inner workings.  Let me know if I can help in any other way.

Link to comment
5 hours ago, goni05 said:

I gave your recent snapshot a try, but the read permission issue still persists.  I also cross posted on GitHub.  I hope just changing the Repository setting to add :snapshot to the end was enough to get what it needed (it seemed to trigger a new download) I will say that if the files are first created locally, then synced, the issue does not present itself.  It is only a problem if Google Drive has the file and it is newly written to disk.  If you get this figured out, I see it as set it and forget it.  Appreciate what you have done to get it here and easily available to everyone.  I wish I knew more about how all this gets setup, because I would help, but I'm not familiar with all the inner workings.  Let me know if I can help in any other way.

Hey happy to say it is now fixed...ish I just chmod 777 on every run of grive (ugly yeah I know). I tried your link but ran into issues.

Couldn't get working this properly. If anyone has more experience with UNIX permissions or Docker for that matter please don't hesitate to open a PR!

To use the new permissions you just need to set another env var PARM=777 for example

Edited by agusalex
Link to comment

So I tried it again, and it failed again, but I now know why!  I was testing out your docker container to see if it would work properly.  I would be syncing ~14TB, but I didn't want to download everything, as I wanted to transfer my files over from my other computer and then sync (keep any significant downloads from occuring).  In order to keep from wasting my time transferring all that to find it just messed everything up, I wanted to test it out.  As it started to download a certain amount, I ended up stopping the docker container.  What I found, after reading through your scripts, was that the permissions modification was only occurring once the sync completes (that's a long time to wait if I tried to download 14TB).  This would NOT be normal scenario, but because I was stopping the docker, the chmod was not occurring on the mount point.  I ended up causing my own problem.  Once I setup a very tiny sync, the process worked as expected.

 

Like you said, this is not ideal, but it works (knowing the limitations).  I still think figuring out how to pass the PUID and PGID would make this just write as the appropriate user from the start and avoid this from the beginning.  If I get some time to dabble in it, I can assist, but I have zero experience with docker, not to mention how Unraid, Docker Hub, and GitHub all work together.  If you have a little tutorial on how you initially got it setup, I can mess around with my own setup until I figure it out.  I would like to help you get this resolved, as I love the sync client over rclone setups.

Link to comment
12 hours ago, goni05 said:

So I tried it again, and it failed again, but I now know why!  I was testing out your docker container to see if it would work properly.  I would be syncing ~14TB, but I didn't want to download everything, as I wanted to transfer my files over from my other computer and then sync (keep any significant downloads from occuring).  In order to keep from wasting my time transferring all that to find it just messed everything up, I wanted to test it out.  As it started to download a certain amount, I ended up stopping the docker container.  What I found, after reading through your scripts, was that the permissions modification was only occurring once the sync completes (that's a long time to wait if I tried to download 14TB).  This would NOT be normal scenario, but because I was stopping the docker, the chmod was not occurring on the mount point.  I ended up causing my own problem.  Once I setup a very tiny sync, the process worked as expected.

 

Like you said, this is not ideal, but it works (knowing the limitations).  I still think figuring out how to pass the PUID and PGID would make this just write as the appropriate user from the start and avoid this from the beginning.  If I get some time to dabble in it, I can assist, but I have zero experience with docker, not to mention how Unraid, Docker Hub, and GitHub all work together.  If you have a little tutorial on how you initially got it setup, I can mess around with my own setup until I figure it out.  I would like to help you get this resolved, as I love the sync client over rclone setups.

Wow yeah that would have taken a long time, glad that you could figure it out before that.
The problem I had with passing PUI and GUI to the container is the following, if I set the user and group inside de docker container to use another thing that is not root, it will not execute my startup script due to permissions.

To try it yourself do the following:

  1. Fork my repo on Github
  2. Install docker on your machine 
  3. Open repo on editor, I suggest VSCode (you can install Docker Plugin there for syntax and stuff)
  4. Make changes, and when you are done
  5. Build with: (this will build a docker container from the Dockerfile on the current directory and it will call it grive2docker and add it to your local pc docker repo) 
    docker build -t "grive2docker" .
  6. Then run it with: (don't forget to set your host folder to the folder you want to map)
    docker run -it -v /your/host/folder:/drive grive2docker
  7. If you have to add variables (ID, SECRET, CODE) you add them like this:
    docker run -it -e ID=CLIENT_ID -e SECRET=SECRET -e CODE=CODE -v /your/host/folder:/drive grive2docker 
  8. Watch the log output and debug
  9. If you want to ssh into the running docker container follow this guide https://phoenixnap.com/kb/how-to-ssh-into-docker-container
    1. That way you can do further debugging.
  10. When you have changes ready to merge just make a PR from your repo to mine
  11. Tell me if you get stuck.

Thanks!

  • Thanks 1
Link to comment
  • 3 weeks later...
1 hour ago, Wolbaz said:

Step 2 gives me:

404. That’s an error.

The requested URL was not found on this server.

 

Not sure if google changed the way they do things.

Thanks for reaching out, link has changed issue is now fixed, updated Wiki and README, new URL now is :

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

Edited by agusalex
Link to comment
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.