Upload files to OneDrive (or Google Drive)

Did anyone already manage to upload a file to OneDrive (or Google Drive) and would like to share his/her code and HowTo?

use case would be something like:

  • send data
  • send Webcam snapshots

Be more specific with ur questions…
What OS?

On my BlueIris server, I have my alerts monitored by the Google Photos sync tool. These motion snapshots are uploaded automatically. Google photos have unlimited storage if you use only 1080p resolution.

Linux, to be specific.
Want to upload mainly binary data collected by openHAB

for example: to sync a linux directory on your OH2 host holding the mapdb Persistence binary files with Google Drive?
/var/lib/openhab2/persistence/mapdb/

there are some tutorials on the web on how do this. I found this: https://www.howtoforge.com/tutorial/sync-documents-with-google-drive-on-ubuntu-linux/

1 Like

oh. I search for API and wondered on how to upload single files from a rule - but hotfolders are even cooler!
Thanks for the hint!

in case someone is interested, I ended up using rclone

available on GitHub:

It’s called “rsync for cloud” and indeed, it’s the swiss army knife for everything, not only can it sync with Google drive or OneDrive, but also FTP, Amazon drive, S3, dropbox, Swift, …
just install it and go! It works really nice! Best thing: it’s completely headless, you won’t need a GUI (except for OAuth2, but that’s covered quite nicely also!).

With this, I can upload my files generated by openHAB and my WebCam pictures. You can either set up a cronjob for syncing a directory - or you can even mount it as a volume. easy as that.