Getting at Google Drive files from Linux
Google Drive has no Linux support. That’s hilarious. Lots of folks have hacked things up though. I settled on rclone as a command line tool because it seemed maintained and was available in Ubuntu. It’s a generic cloud drive tool able to get at files, etc from many different providers.
The one-time-setup for Google Drive access is awful. It requires OAuth, which is a nice idea but then has the lovely usability of OAuth vs. command line tools. Lots of copying and pasting tokens. Even worse they really want you to set up your own API key. The end result is I had to do a bunch of “register as a Google developer” stuff, including maybe even generating a review request for my OAuth app called “Nelson’s private experiment do not use” (since private apps are only available to GSuite customers). The irony of this being somewhat my fault; I built the very first Google API key system back in 2001. No good deed goes unpunished.
Anyway, once set up it seems to work. My credentials are apparently stored in ~/.config/rclone/ Example commands:
- rclone ls ‘Google Drive:/GPSLogger for Android/’
- rclone --progress sync ‘Google Drive:/GPSLogger for Android/’ ‘./gdrive’
I’ve found some awful behavior from Google though; Google Drive seems to be converting my CSV text files into Google Sheets; I can’t get the CSV back, no matter which Google Drive client I try. I filed a bug on GPSLogger about it, but I wonder if it’s my own mistake.