[UPDATE] After considering all the options below, I went for Jeremy’s Python Script. It looked like the simplest method – if it worked (and it did!). Here are the detailed instructions I wrote for getting it to work. Jeremy’s Blog got the Google Authentication steps wrong, because Google changes their processes without notice.
So Many Options
There are some options to consider. One is Grive, which, if you believe the Internet, doesn’t work anymore.
However: “There was previously an open-source command-line tool named Grive and a graphical counterpart named Grive Tools. However, Grive has been abandoned and is no longer functional due to changes in the Google Drive API. Instead of updating the old open-souce application, the developers created a new application named overGrive and are selling it for $5” (HowToGeek).
A Command-line Tool by a Google Drive Developer, “Drive”
If you’re more of a Terminal geek, “drive” is a small command line program that runs on both Linux and macOS. It’s open-source and written in Google’s “Go” programming language. You need to install the GO programming language. This program was originally written by Burcu Dogan, aka rakyll, a Google employee who has worked for Google Drive’s platform team. It’s even copyrighted by Google.
This one is a contender. Synchronizes a directory between the Pi and Google Drive. So if you delete a file from one, it will delete from the other, etc. You can’t independently upload/download.
Motion Google Drive Uploader
This one looks promising. It’s a python script that was written for Motion.
I’m a little skeptical of thise, due to the amount of setup it requires and that you need to refer to a .ru site for information. https://github.com/Grive/grive
A paid application. $5.
I can create a file on my web server that I can write to via PHP. Have the Raspberry Pi monitor that file for content, and if it finds content, execute a BASH script.
For example, I write to my file at https://www.myserver.com/pi/commands.txt, and I add “uphoto” to that text file. The Ra spi reads that file, and if it has “uphoto” in it, it executes a BASH script to upload the contents of a photo directory to Google Drive. I then overwrite commands.txt with “dphoto” that tells the Raspi to delete all the photos.