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

5
  • 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, 2014 at 19:03
  • which kind of "hacks" it's way through the browser interface?
    – evan54
    Apr 20, 2014 at 19:04
  • 1
    you can check this out github.com/prasmussen/gdrive Jun 17, 2017 at 7:07
  • 2
    I just do ./gdrive-linux-x64 upload yourfile.rar. And Then yourfile.rar will be uploaded to your gdrive home folder Jun 17, 2017 at 7:08
  • The service Couchdrop.io acts as middleman and is free up to 1GB
    – brasofilo
    Dec 31, 2018 at 5:38

4 Answers 4

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
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.

2
  • 3
    Nice trick, pity that's not exactly what's being asked. I need to send a big file and email attachments are restricted to 25MB
    – brasofilo
    Dec 31, 2018 at 5:35
  • 1
    No way that can be called an "easy" approach.
    – raj
    May 6, 2021 at 22:00
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.