rclone for MS OneDrive

This software syncs your HPC directory with many popular cloud storage services. Here we will cover instructions for Microsoft's OneDrive.

Set-up and Configuration

First, we need to add rclone to your path. You can also check to make sure you're sourcing the correct file using the which_ _command.

[[email protected] ~]$ source /share/apps/rclone/env.sh
[[email protected] ~]$ which rclone

If you wish to have a separate directory which will contain your OneDrive, make it and navigate there before continuing. For example:

[[email protected] ~]$ mkdir rclone_OneDrive
[[email protected] ~]$ cd rclone_OneDrive/

Next, run the rclone configuration. A prompt will notify you that no remote connections exist. To set up a new connection, typen.

[[email protected] rclone_OneDrive]$ rclone config
2017/04/09 18:08:27 NOTICE: Config file "/home/Wendi.Sapp/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config

It will prompt you to enter a name. Enter the name, in this case, remote.


A lot of information will populate the screen. The first will be a list of available services. In this section, we will choose #10, OneDrive.

Type of storage to configure.
Choose a number from below, or type in your own value
1 / Amazon Drive
\ "amazon cloud drive"
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
\ "s3"
3 / Backblaze B2
\ "b2"
4 / Dropbox
\ "dropbox"
5 / Encrypt/Decrypt a remote
\ "crypt"
6 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
7 / Google Drive
\ "drive"
8 / Hubic
\ "hubic"
9 / Local Disk
\ "local"
10 / Microsoft OneDrive
\ "onedrive"
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
12 / SSH/SFTP Connection
\ "sftp"
13 / Yandex Disk
\ "yandex"

The next two prompts will need to be left blank. Simply press _Enter _to move to the next.

OneDrive Application Client Id - leave blank normally.
OneDrive Application Client Secret - leave blank normally.

The next step will ask if you would like to use an autoconfiguration. Since we access the HPC remotely, we must manually connect. Therefore, type n.

Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No

The configuration will provide a web address for you to copy and paste into your browser. A browser window may automatically appear.

If your browser doesn't open automatically go to the following link: https://microsoft.accounts.com/o/oauth2/auth?client_id=20224.apps.Driveusercontent.com
Log in and authorize rclone for access

In the browser window, either select the OneDrive account you wish to use or sign into one.

Microsoft will ask if you'd like to provide account access to rclone. Select Allow. Then, it will give you a code to copy and paste into your terminal window.

Enter verification code

Your terminal will ask you to verify your actions. If there are no errors, type y.

client_id =
client_secret =
token = {"access_token":"ya29.GlsoBJR8t-nYjipMBY40mg0NcNPy09Gr0bJ0fpJmjPaZHWkNgrzeQoVkf5YxUabwETj-R9sBhEm-WX_HvAbrjQYZr-
y) Yes this is OK
e) Edit this remote
d) Delete this remote

Finally, we'll need to exit the set-up. Do so by typing q.

Current remotes:
Name Type
==== ====
remote drive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config

You have completed the set-up for Microsoft OneDrive.


In this section, we'll cover a few basic commands to get your HPC directories and OneDrive folders synced.

First, you can list files and directories in the remote drive (OneDrive). In this command, you start by using the rclone command, followed by the list command. Then, the name of the remote service is needed, here the name isremote. After the name, include a colon and then the path (folder). The following is the standard format, followed by an example.

rclone ls remote:path
rclone ls remote:Miscellaneous/Scripts/

Similarly, you can list the directories in your cloud storage.

rclone lsd remote:path

If you'd like to sync two folders (one on HPC and one on OneDrive), you can use the following command:

rclone sync source:path destination:path

If dest:path doesn’t exist, it is created and the source:path contents go there.