Erik Solis | May 12th, 2024


The program we will be using to manage our Google Drive in this tutorial is called rclone

rclone is a flexible multi-platform command-line utility for managing files in cloud storage including, but not limited to Google Drive. It is a feature-rich alternative to using your cloud storage vendors' web UI.

In this article, I will teach you how to install, configure, and use rclone to interface with Google Drive.

What this article covers


Installation

You can install rclone via Homebrew (https://brew.sh), any other package manager, or from the official website at (https://rclone.org/downloads/)

brew install rclone

Configuration

First we need to configure rclone to connect to Google Drive. Run the command below and follow the prompts to create a new remote connection for Google Drive. It’s also recommended but not required, to make your own OAuth client id using the Google Cloud Console (https://console.cloud.google.com) for rclone to use, as the default client id rclone uses is shared by all instances (and all users) of rclone using the default configuration, and will be subject to rate limitation.

You can follow the tutorial at the following link to do this (https://rclone.org/drive/#making-your-own-client-id). After you’ve created your credentials, provide the OAuth client id and client secret to rclone. You'll then be prompted to authenticate with Google in your browser.

rclone config

Once you’re finished, return to the command line. rclone will ask you whether to save the remote configuration you’ve created. Enter y to confirm. You will then return to the config menu and can enter q to exit. Following this, you should be all set to start using rclone.

Uploading to Drive

You can upload files (or entire folders recursively) to a specific folder in Google Drive, using the following command syntax.

rclone copy /path-to-file-or-folder Drive:/target-folder

Downloading from Drive