Rclone Usage Guide

Table of Contents

Rclone is a versatile, free, and open-source command-line program that synchronizes and transfers files and directories to and from a wide range of storage endpoints. It works on Windows, macOS, and Linux and supports multiple cloud storage providers, including popular services like:

  • Google Drive
  • Amazon S3
  • Dropbox
  • Microsoft OneDrive

Rclone has a syntax that is very similar to Unix so users should find it recognizable.  Rclone can be used with a wide variety of cloud services including box, but this example deals specifically with OneDrive. An rclone installation on a device with a web browser is required to complete this configuration.

 

Configuration

Rclone has an interactive configuration menu to assist users in properly setting it up.  From novadtn.its.iastate.edu enter the interactive configuration menu by typing:

rclone config

This will lead to the following selection screen.  Enter 'n' for a New remote connection:

No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

Now we need to enter a name, note it can be arbitrary but you'll need to remember it:

Enter name for new remote.
name> MYONEDRIVE

Next we need to tell it one what type of storage we are configuring.  In the case of MS OneDrive it's number 38. 

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
  \ (fichier)
2 / Akamai NetStorage
  \ (netstorage)
... 
38 / Microsoft OneDrive
  \ (onedrive)
...
Storage> 38

The next two questions can be left blank.   After that select the Region (1 in this case):

Option region.
Choose national cloud region for OneDrive.
Choose a number from below, or type in your own value of type string.
Press Enter for the default (global).
1 / Microsoft Cloud Global
  \ (global)
...
region> 1

The next option leave blank.  You also want to select No for editing the advanced config.

The next section is when you will need your own local machine with Rclone installed.  It'll ask about the host we are on to which you reply no:

Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n> N

In a separate machine under your control following the instructions enter:

rclone authorize "MYONEDRIVE"

or if you are on Windows it'll look like:
.\rclone.exe authorize "MYONEDRIVE".

This will open up a browser session for you to authenticate with ISU.  Afterwards a giant JSON blob will spit out in the local terminal.  You need to copy and paste that value into the remote terminal session.

Enter a value.
config_token> 

After that you'll receive another prompt to select what type of account this is, selecting 1 in this instance:

Option config_type.
Type of connection
Choose a number from below, or type in an existing value of type string.
Press Enter for the default (onedrive).
1 / OneDrive Personal or Business
  \ (onedrive)
...

Last select the correct available driveid:

Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own value of type string.
Press Enter for the default (b!6i5ICZnh6k-raRV8zXj0N28Jjg0bHW1FmBWOI_3K2IXEQt63VRdWTbDlYqWPoucB).
1 / OneDrive (business)

Next you will be presented with a URL that you'll want to accept the default (Yes).  After that configuration is complete and it'll spit out a list of all the configured variables.  It'll ask you if you want to save, edit or delete.  

Usage

Navigating

To view the list of directories issue the command:
rclone lsd source:

Where source: is the drive you named in the previous steps during configure.  

To view the contents of of a directory issue:

rclone ls source:

File Operations

To copy from one directory to another issue:
rclone copy source:sourcepath dest:destpath

Files can be moved using the move command:

rclone move source:path dest:path [flags]

Files can be deleted with the delete command:

rclone delete remote:path [flags]

Additional Resources

Rclone has extensive documentation that can be found at: Rclone Documentation