8

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
  • 695
  • 4
  • 10
  • 19
  • 3
    scp and rsync use ssh. AFAIK Google Drive doesn't offer ssh. rsync can also connect to a rsync daemon, but I doubt Google Drive offers that as well. AFAIK they don't even offer FTP, so probably the only way is creating a script using cURL. – Alex Apr 20 '14 at 19:03
  • which kind of "hacks" it's way through the browser interface? – evan54 Apr 20 '14 at 19:04
  • 1
    you can check this out https://github.com/prasmussen/gdrive – Oki Erie Rinaldi Jun 17 '17 at 07:07
  • 2
    I just do **`./gdrive-linux-x64 upload yourfile.rar`**. And Then `yourfile.rar` will be uploaded to your gdrive home folder – Oki Erie Rinaldi Jun 17 '17 at 07:08
  • The service [Couchdrop.io](https://couchdrop.io/features) acts as middleman and is free up to 1GB – brasofilo Dec 31 '18 at 05:38

4 Answers4

2

There is a good tutorial here.

To summarize the link:

  • If not already installed, install curl
  • create Google security certificate
  • test from command line
  • create Python script to automate
WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401
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 [email protected]

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

JKar
  • 19
  • 4
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,915
  • 13
  • 19
  • 31
hacknorris
  • 22
  • 8
0

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
  • 9,212
  • 7
  • 40
  • 79