2015-10-04 23:08:31 +02:00
|
|
|
|
---
|
2017-01-09 06:09:19 +01:00
|
|
|
|
title: "Microsoft OneDrive"
|
|
|
|
|
description: "Rclone docs for Microsoft OneDrive"
|
2015-10-04 23:08:31 +02:00
|
|
|
|
date: "2015-10-14"
|
|
|
|
|
---
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
<i class="fa fa-windows"></i> Microsoft OneDrive
|
2015-10-04 23:08:31 +02:00
|
|
|
|
-----------------------------------------
|
|
|
|
|
|
|
|
|
|
Paths are specified as `remote:path`
|
|
|
|
|
|
|
|
|
|
Paths may be as deep as required, eg `remote:directory/subdirectory`.
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
The initial setup for OneDrive involves getting a token from
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Microsoft which you need to do in your browser. `rclone config` walks
|
|
|
|
|
you through it.
|
|
|
|
|
|
|
|
|
|
Here is an example of how to make a remote called `remote`. First run:
|
|
|
|
|
|
|
|
|
|
rclone config
|
|
|
|
|
|
|
|
|
|
This will guide you through an interactive setup process:
|
|
|
|
|
|
|
|
|
|
```
|
2016-02-21 14:39:04 +01:00
|
|
|
|
No remotes found - make a new one
|
2015-10-04 23:08:31 +02:00
|
|
|
|
n) New remote
|
2016-02-21 14:39:04 +01:00
|
|
|
|
s) Set configuration password
|
|
|
|
|
n/s> n
|
2015-10-04 23:08:31 +02:00
|
|
|
|
name> remote
|
2016-02-21 14:39:04 +01:00
|
|
|
|
Type of storage to configure.
|
|
|
|
|
Choose a number from below, or type in your own value
|
2016-07-11 13:42:44 +02:00
|
|
|
|
1 / Amazon Drive
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "amazon cloud drive"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
2 / Amazon S3 (also Dreamhost, Ceph, Minio)
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "s3"
|
|
|
|
|
3 / Backblaze B2
|
|
|
|
|
\ "b2"
|
|
|
|
|
4 / Dropbox
|
|
|
|
|
\ "dropbox"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
5 / Encrypt/Decrypt a remote
|
|
|
|
|
\ "crypt"
|
|
|
|
|
6 / Google Cloud Storage (this is not Google Drive)
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "google cloud storage"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
7 / Google Drive
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "drive"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
8 / Hubic
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "hubic"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
9 / Local Disk
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "local"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
10 / Microsoft OneDrive
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "onedrive"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
11 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "swift"
|
2017-03-05 11:14:57 +01:00
|
|
|
|
12 / SSH/SFTP Connection
|
|
|
|
|
\ "sftp"
|
|
|
|
|
13 / Yandex Disk
|
2016-02-21 14:39:04 +01:00
|
|
|
|
\ "yandex"
|
2017-01-09 06:09:19 +01:00
|
|
|
|
Storage> 10
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Microsoft App Client Id - leave blank normally.
|
2017-01-09 06:09:19 +01:00
|
|
|
|
client_id>
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Microsoft App Client Secret - leave blank normally.
|
2017-01-09 06:09:19 +01:00
|
|
|
|
client_secret>
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Remote config
|
2016-02-21 14:39:04 +01:00
|
|
|
|
Use auto config?
|
|
|
|
|
* Say Y if not sure
|
|
|
|
|
* Say N if you are working on a remote or headless machine
|
|
|
|
|
y) Yes
|
|
|
|
|
n) No
|
|
|
|
|
y/n> y
|
2015-10-04 23:08:31 +02:00
|
|
|
|
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
|
|
|
|
|
Log in and authorize rclone for access
|
|
|
|
|
Waiting for code...
|
|
|
|
|
Got code
|
|
|
|
|
--------------------
|
|
|
|
|
[remote]
|
2017-01-09 06:09:19 +01:00
|
|
|
|
client_id =
|
|
|
|
|
client_secret =
|
2015-10-04 23:08:31 +02:00
|
|
|
|
token = {"access_token":"XXXXXX"}
|
|
|
|
|
--------------------
|
|
|
|
|
y) Yes this is OK
|
|
|
|
|
e) Edit this remote
|
|
|
|
|
d) Delete this remote
|
|
|
|
|
y/e/d> y
|
|
|
|
|
```
|
|
|
|
|
|
2016-01-07 16:20:32 +01:00
|
|
|
|
See the [remote setup docs](/remote_setup/) for how to set it up on a
|
|
|
|
|
machine with no Internet browser available.
|
|
|
|
|
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Note that rclone runs a webserver on your local machine to collect the
|
|
|
|
|
token as returned from Microsoft. This only runs from the moment it
|
|
|
|
|
opens your browser to the moment you get back the verification
|
|
|
|
|
code. This is on `http://127.0.0.1:53682/` and this it may require
|
|
|
|
|
you to unblock it temporarily if you are running a host firewall.
|
|
|
|
|
|
|
|
|
|
Once configured you can then use `rclone` like this,
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
List directories in top level of your OneDrive
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
|
|
|
|
rclone lsd remote:
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
List all the files in your OneDrive
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
|
|
|
|
rclone ls remote:
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
To copy a local directory to an OneDrive directory called backup
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
|
|
|
|
rclone copy /home/source remote:backup
|
|
|
|
|
|
2016-01-13 11:29:43 +01:00
|
|
|
|
### Modified time and hashes ###
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
OneDrive allows modification times to be set on objects accurate to 1
|
2015-10-04 23:08:31 +02:00
|
|
|
|
second. These will be used to detect whether objects need syncing or
|
|
|
|
|
not.
|
|
|
|
|
|
2016-01-13 11:29:43 +01:00
|
|
|
|
One drive supports SHA1 type hashes, so you can use `--checksum` flag.
|
|
|
|
|
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
|
|
|
|
### Deleting files ###
|
|
|
|
|
|
|
|
|
|
Any files you delete with rclone will end up in the trash. Microsoft
|
|
|
|
|
doesn't provide an API to permanently delete files, nor to empty the
|
|
|
|
|
trash, so you will have to do that with one of Microsoft's apps or via
|
2017-01-09 06:09:19 +01:00
|
|
|
|
the OneDrive website.
|
2015-10-04 23:08:31 +02:00
|
|
|
|
|
2015-11-14 12:38:35 +01:00
|
|
|
|
### Specific options ###
|
|
|
|
|
|
|
|
|
|
Here are the command line options specific to this cloud storage
|
|
|
|
|
system.
|
|
|
|
|
|
|
|
|
|
#### --onedrive-chunk-size=SIZE ####
|
|
|
|
|
|
|
|
|
|
Above this size files will be chunked - must be multiple of 320k. The
|
|
|
|
|
default is 10MB. Note that the chunks will be buffered into memory.
|
|
|
|
|
|
|
|
|
|
#### --onedrive-upload-cutoff=SIZE ####
|
|
|
|
|
|
|
|
|
|
Cutoff for switching to chunked upload - must be <= 100MB. The default
|
|
|
|
|
is 10MB.
|
|
|
|
|
|
2015-10-04 23:08:31 +02:00
|
|
|
|
### Limitations ###
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
Note that OneDrive is case insensitive so you can't have a
|
2015-10-04 23:08:31 +02:00
|
|
|
|
file called "Hello.doc" and one called "hello.doc".
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
Rclone only supports your default OneDrive, and doesn't work with One
|
2015-10-04 23:08:31 +02:00
|
|
|
|
Drive for business. Both these issues may be fixed at some point
|
|
|
|
|
depending on user demand!
|
|
|
|
|
|
2017-01-09 06:09:19 +01:00
|
|
|
|
There are quite a few characters that can't be in OneDrive file
|
2015-10-04 23:08:31 +02:00
|
|
|
|
names. These can't occur on Windows platforms, but on non-Windows
|
|
|
|
|
platforms they are common. Rclone will map these names to and from an
|
|
|
|
|
identical looking unicode equivalent. For example if a file has a `?`
|
|
|
|
|
in it will be mapped to `?` instead.
|
2016-11-14 05:23:26 +01:00
|
|
|
|
|
|
|
|
|
The largest allowed file size is 10GiB (10,737,418,240 bytes).
|