-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to synchronize with Google Drive #4
Comments
Nice. Thanks! |
Looks awesome. Will try that out. |
Awesome! I just went through all steps and althought I've had a RPI for just two days and never used any Linux-system before everything seems to be working. gdrive is uploading all photos and video right now. :-) 👍 |
Thanks for these instructions! I really like being able to reference and store my photos on my Google Drive. I am having an issue when the images are uploaded to Google Drive. It appears that each upload generates a new folder for the images. This has caused my output folder to explode with repeated folders. It also appears that the same images are being uploaded to multiple folders repeatedly. I've included images of the issues below. Any help resolving this would be great! Thank you! |
I've ran into two problems. Everything worked for a couple of days, but then it stopped working.
|
Good Morning Limeiz, Looking at the cron task i noticed that the data dump does not point to the correct location. "*/5 * * * * /data/gdrive/sync.sh >/dev/nul" the /dev/nul should read as /dev/null..... also look at I'm currently sitting a Linux certification When I looked at the device folder (/dev) the /nul was not present in the OS. Worth a shot............ MotionUK |
@malcolmct - thanks for an amazing contribution. MotionUK |
@MotionUK Yeah, I noticed that "/dev/nul" was typed wrong, after googling about it for a few minutes. I've already corrected that. The weird thing is that it worked for a couple of days and then suddenly stopped working. I'll try and reinstall the whole thing and see if that helps. I'll get back here with the results. There shouldn't exist any folder called /dev/null, it's a "black hole" which is commonly used on *nix systems to dump data which you don't want to use. It simply makes sure that any output sync.sh produces is being discarded and not displayed. |
It seems like my cron wasn't running. The following made gdrive start syncing.
I also edited the sync.sh script a bit, because I noticed it ran gdrive three times every cron instance. By using this (http://unix.stackexchange.com/questions/22044/correct-locking-in-shell-scripts) method with a lockfile I make sure the script is only running one instance. Here's my version of sync.sh: https://gist.github.com/Limeliz/4389cc40744331736c59 Oh, and I noticed from the gdrive output logs (I've got my crontab setup like this, to debug the sync.sh outputs: @russellgeoff I also had a problem with duplicate files and folders. I'm not sure if it was because gdrive was running multiple instances, but adding |
@Limeliz Many thanks for your comments and improvements! I've modified my original posting to incorporate Limeliz's changes. I also point to his version of the sync.sh script. I think I must have originally tested mine on Raspian and hadn't noticed the absence of pgrep in MotionEyeOS. |
I've updated the Limeliz's sync script to also pull changes (including deletions) from Google Drive. This allows to delete files and folders in Google Drive and these files will then be deleted from MotionEyeOS as well. Just in case you're interested: https://gist.github.com/mastix/1a93fb8c6114a3ba79ed |
amazing work |
Thanks for this! |
I have added a separate page on Wiki with the How-To above therefore closing this issue. |
There is no 'wget' in motionEYE OS |
Use curl. |
Add fixes for some of the build failures caused by strict-overflow warnings. Patches #1, #2, and #4 are upstream. Patch #3 is pending upstream. Fixes: http://autobuild.buildroot.net/results/923/9239f230629ca4e381af5e8f43989997d9bfde99/ http://autobuild.buildroot.net/results/618/6187b92bcdfd9281683c37906ae74f2e0c5e6d0e/ http://autobuild.buildroot.net/results/9eb/9eb5ed92a923f0c038e3d913289eddc1cda1b62f/ Cc: Scott Fan <fancp2007@gmail.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
motionEyeOS is great, but having seen a number of requests for Google Drive functionality, I thought I should share how I got it working.
Here are step-by-step instructions which also work with motionPie:
the whole block into your SSH session:
that you are logged into Google (for example, you could open Gmail).
Back in your SSH session, enter and execute:
gdrive init
This will produce a long, complex URL which you should copy and paste into your PC browser's
address line, then press Enter.
You'll need to give permission to manage files in your Google Drive and will then be returned a
code to copy back into your SSH session where gdrive is waiting.
A success will return nothing.
Drive on a regular schedule.
*/5 * * * * /data/gdrive/sync.sh >> /data/log/gdrive_output.log 2>&1
Then quit nano with control-x and save the crontab entry.
That's it. You can have it up and running in about five minutes and it seems to work without any
unforeseen problems.
***Modified on 11-20-2015 to incorporate changes suggested by Limeliz
The text was updated successfully, but these errors were encountered: