9

I would like to just upload files to google drive from the command line. I don't care about synchronisation. I just want to upload things to google drive and if they exist they get replaced if not they are created.

I know grive exists but that syncs everything from google drive to the folder you use which isn't what I want.

I was wondering if there is a solution to this, through scp or something similar?

thanks

evan54
  • 745

4 Answers4

3

There is a good tutorial: Google Drive File Upload Using The Terminal.

To summarize the link:

  • If not already installed, install curl
  • create Google security certificate
  • test from command line
  • create Python script to automate
1

rclone is a good answer to your question. Configuration and usage is detailed in rclone web site. By using rclone you can easily switch to other supported cloud providers described in rclone home page.

FedKad
  • 13,420
1

send the file to your gmail account as attachment and from there you can save it to google drive directly.

uuencode file.txt file.txt | mail your_email@gmail.com

I know this is not direct to gdrive, but as there is no other options available I use this easy approach.

JKar
  • 19
0

If you're logged into gdrive in the system (in ubuntu settings) - just enter into the root and paste to the directory: /run/user/1000/gvfs/google-drive:host=gmail.com,user=(first_part_of_your_mail_here)

If you didn't log in - you need to mess up with networking tools.

ThunderBird
  • 1,963
  • 13
  • 22
  • 31