Is there a command line utility to script uploads to Google Drive and share items?

10,280

Solution 1

I don't know if I understand you right, but Google Drive provides a "local" folder, like dropbox, where you can put your file in it and it will sync with the google-drive server.

So why not create a folder inside that google-drive folder and work in there. You can use one folder and share it with your team-members. So, every time you save your work, it will be saved and uploaded to the shared folder from google-drive.

Solution 2

There is a utility called gdrive which acts as a Google Drive client for Linux, Windows and macOS.

It has the following functionalitites:

  • List files
  • Download file or directory
  • Download all files and directories matching query
  • Upload file or directory
  • Upload file from stdin
  • Update file, this creates a new revision of the file
  • Show file info
  • Create directory
  • Share file or directory
  • List files permissions
  • Revoke permission
  • Delete file or directory
  • List all syncable directories on drive
  • List content of syncable directory
  • Sync drive directory to local directory
  • Sync local directory to drive
  • List file changes
  • List file revisions
  • Download revision
  • Delete file revision
  • Upload and convert file to a google document, see 'about import' for available conversions
  • Export a google document
  • Google drive metadata, quota usage

The tool was unmaintained for a few years but should now (soon?) be getting updates.

Share:
10,280

Related videos on Youtube

Johan Bezem
Author by

Johan Bezem

Updated on September 18, 2022

Comments

  • Johan Bezem
    Johan Bezem almost 2 years

    Me and my team are using Google Drive to share results of our build processes. We used to have a shared drive on some server, accessible to all members. We run Windows XP and Win7.
    Now, several team members from other locations have joined the team, and we have all switched to Google Drive - this decision is final. So far I have only seen the web front-end and I'm not aware of any other FEs.

    However, manually copying build results into Google Drive is tedious, and I would like to automate things: Uploading, and sharing with the team. I have no intention of writing some extensive piece of software using the SDK, but a small script is not a problem.
    I checked the web, and found dozens of snippets using the Drive SDK, but they still need much work; command-line utilities running on various flavors of Unix/Linux, not an option for Windows users; and one Windows tool, GoogleCL. The latter seemed promising, but has not been updated since 2011, and apparently isn't able to share the uploaded file with a team.

    I see two possibilities: An automatic synchronisation between a specific Windows folder on my machine and a specific Google Drive folder that is already and permanently shared within the team; or a command line utility like copy/xcopy/robocopy to upload and share files using Google Drive.
    Any ideas?

  • Johan Bezem
    Johan Bezem over 10 years
    +1 You are right, of course. But my problem was that I had only seen the web front-end, and was not aware of the googledrivesync.exe application I need to install before this directory becomes available.<br>Now I just need to request admin-privilidges to install it ;)
  • GoYun.Info
    GoYun.Info almost 10 years
    A cross platform command line would be helpful for Linux environment too. But it seems that there is no official one available for now.
  • Jasmine Hegman
    Jasmine Hegman almost 7 years
    A binary gdrive written in Go has appeared that is available for Windows, Linux, and Mac and supports upload, download, share, import/export, and syncing functionality. All of the features the OP originally desired and then some.