agusalex Posted September 25, 2020 Share Posted September 25, 2020 (edited) 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 December 24, 2020 by agusalex Quote Link to comment
mattybeens Posted September 26, 2020 Share Posted September 26, 2020 It seems if you use an SMB share, any download files from google drive do not have read permissions after they have been downloaded. Quote Link to comment
agusalex Posted September 26, 2020 Author Share Posted September 26, 2020 (edited) 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 September 29, 2020 by agusalex Quote Link to comment
DTMHibbert Posted September 27, 2020 Share Posted September 27, 2020 Is it possible to include date and time is the logs for this? Quote Link to comment
agusalex Posted September 29, 2020 Author Share Posted September 29, 2020 On 9/27/2020 at 10:38 AM, DTMHibbert said: Is it possible to include date and time is the logs for this? Sorry can you clarify your question ? I'm not sure what do you mean Quote Link to comment
DTMHibbert Posted October 1, 2020 Share Posted October 1, 2020 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 Quote Link to comment
agusalex Posted October 2, 2020 Author Share Posted October 2, 2020 Sure thing! update to latest version (1.2 or latest tag) couldn't manage to add that to Grive itself but to it's runs so that should give you a range on which time the error might have occurred! (Also thanks to victorkp we now have sleep time as a parameter to avoid high CPU usage all the time ) Quote Link to comment
akshunj Posted November 21, 2020 Share Posted November 21, 2020 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! 1 Quote Link to comment
agusalex Posted November 21, 2020 Author Share Posted November 21, 2020 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. 1 Quote Link to comment
DeadChimi Posted November 23, 2020 Share Posted November 23, 2020 (edited) 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 November 23, 2020 by DeadChimi 1 Quote Link to comment
dziewuliz Posted December 3, 2020 Share Posted December 3, 2020 (edited) 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 December 4, 2020 by dziewuliz Quote Link to comment
Archemedees Posted December 22, 2020 Share Posted December 22, 2020 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? Quote Link to comment
agusalex Posted December 24, 2020 Author Share Posted December 24, 2020 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. Quote Link to comment
agusalex Posted December 24, 2020 Author Share Posted December 24, 2020 (edited) 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 December 24, 2020 by agusalex Quote Link to comment
agusalex Posted December 24, 2020 Author Share Posted December 24, 2020 Now Grive2 Supports Crontabs! Since release 1.3 Update to latest and you should be up and running. Ram usage is reduced too seeing < 3 MB of usage when idle Quote Link to comment
rrr01 Posted February 17, 2021 Share Posted February 17, 2021 Hello. It seems the read permission issue still exists. Is there any way to fix it? Quote Link to comment
agusalex Posted February 17, 2021 Author Share Posted February 17, 2021 6 hours ago, rrr01 said: Hello. It seems the read permission issue still exists. Is there any way to fix it? Hi, not at the moment, I will try to fix that soon, I know its been a while, let me get back to you. Quote Link to comment
goni05 Posted March 11, 2021 Share Posted March 11, 2021 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. Quote Link to comment
agusalex Posted March 12, 2021 Author Share Posted March 12, 2021 (edited) 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 March 12, 2021 by agusalex Quote Link to comment
goni05 Posted March 16, 2021 Share Posted March 16, 2021 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. Quote Link to comment
agusalex Posted March 16, 2021 Author Share Posted March 16, 2021 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: Fork my repo on Github Install docker on your machine Open repo on editor, I suggest VSCode (you can install Docker Plugin there for syntax and stuff) Make changes, and when you are done 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" . 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 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 Watch the log output and debug If you want to ssh into the running docker container follow this guide https://phoenixnap.com/kb/how-to-ssh-into-docker-container That way you can do further debugging. When you have changes ready to merge just make a PR from your repo to mine Tell me if you get stuck. Thanks! 1 Quote Link to comment
goni05 Posted March 17, 2021 Share Posted March 17, 2021 I'll give it a shot when i get some free time. Thanks for the clear instructions. 1 Quote Link to comment
Wolbaz Posted April 5, 2021 Share Posted April 5, 2021 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. 1 Quote Link to comment
agusalex Posted April 5, 2021 Author Share Posted April 5, 2021 (edited) 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 April 5, 2021 by agusalex Quote Link to comment
PandaAT Posted April 27, 2021 Share Posted April 27, 2021 Could someone help me out on the grive params? Im trying to use --ignore and exclude movie files like .mkv or .mov but im struggling with the perl regex 😅 Quote Link to comment
Recommended Posts
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.