Skip to content

Instantly share code, notes, and snippets.

@gryan11
Last active December 22, 2020 01:55
Show Gist options
  • Save gryan11/059e4e5487525fcf3be96c2744580978 to your computer and use it in GitHub Desktop.
Save gryan11/059e4e5487525fcf3be96c2744580978 to your computer and use it in GitHub Desktop.
Downloading folders + large files from google drive

Setup

Install rclone from https://rclone.org/downloads/

curl https://rclone.org/install.sh | sudo bash

Run rclone config for google drive (setup directions here).

Commands:

To see directories and files in drive (note: I set up my google drive remote name as 'gdrive'):

rclone lsd gdrive:/ # dirs
rclone ls gdrive:/ # dirs + files

Folder and File downloads

Given a folder 'data' in my google drive I want to download to server:

rclone copy gdrive:/data . -P

If someone shares a folder, use --drive-shared-with-me:

rclone copy gdrive:/shared_data . -P --drive-shared-with-me

Public File downloads:

First check version rclone -V, if less than 1.54 install beta:

curl https://rclone.org/install.sh | sudo bash -s beta

Now get public file id, for example given link

https://drive.google.com/file/d/FILE_ID/view

where FILE_ID will be hash string, run

rclone backend copyid gdrive: FILE_ID `pwd`/example_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment