2014-07-18 03:03:11 +08:00
|
|
|
|
---
|
|
|
|
|
title: "Dropbox"
|
|
|
|
|
description: "Rclone docs for Dropbox"
|
2020-03-18 21:31:04 +08:00
|
|
|
|
date: "2020-03-18"
|
2014-07-18 03:03:11 +08:00
|
|
|
|
---
|
|
|
|
|
|
2020-05-22 19:22:52 +08:00
|
|
|
|
{{< icon "fab fa-dropbox" >}} Dropbox
|
2014-07-18 03:03:11 +08:00
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
|
|
Paths are specified as `remote:path`
|
|
|
|
|
|
|
|
|
|
Dropbox paths may be as deep as required, eg
|
|
|
|
|
`remote:directory/subdirectory`.
|
|
|
|
|
|
|
|
|
|
The initial setup for dropbox involves getting a token from Dropbox
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
n) New remote
|
|
|
|
|
d) Delete remote
|
|
|
|
|
q) Quit config
|
|
|
|
|
e/n/d/q> n
|
|
|
|
|
name> remote
|
2016-02-21 21:39:04 +08:00
|
|
|
|
Type of storage to configure.
|
|
|
|
|
Choose a number from below, or type in your own value
|
2019-08-26 17:47:17 +08:00
|
|
|
|
[snip]
|
|
|
|
|
XX / Dropbox
|
2016-02-21 21:39:04 +08:00
|
|
|
|
\ "dropbox"
|
2019-08-26 17:47:17 +08:00
|
|
|
|
[snip]
|
|
|
|
|
Storage> dropbox
|
2015-10-03 21:23:12 +08:00
|
|
|
|
Dropbox App Key - leave blank normally.
|
2017-01-09 13:09:19 +08:00
|
|
|
|
app_key>
|
2015-10-03 21:23:12 +08:00
|
|
|
|
Dropbox App Secret - leave blank normally.
|
2017-01-09 13:09:19 +08:00
|
|
|
|
app_secret>
|
2014-07-18 03:03:11 +08:00
|
|
|
|
Remote config
|
|
|
|
|
Please visit:
|
|
|
|
|
https://www.dropbox.com/1/oauth2/authorize?client_id=XXXXXXXXXXXXXXX&response_type=code
|
|
|
|
|
Enter the code: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXX
|
|
|
|
|
--------------------
|
|
|
|
|
[remote]
|
2017-01-09 13:09:19 +08:00
|
|
|
|
app_key =
|
|
|
|
|
app_secret =
|
2014-07-18 03:03:11 +08:00
|
|
|
|
token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
|
|
--------------------
|
|
|
|
|
y) Yes this is OK
|
|
|
|
|
e) Edit this remote
|
|
|
|
|
d) Delete this remote
|
|
|
|
|
y/e/d> y
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can then use it like this,
|
|
|
|
|
|
|
|
|
|
List directories in top level of your dropbox
|
|
|
|
|
|
|
|
|
|
rclone lsd remote:
|
|
|
|
|
|
|
|
|
|
List all the files in your dropbox
|
|
|
|
|
|
|
|
|
|
rclone ls remote:
|
|
|
|
|
|
|
|
|
|
To copy a local directory to a dropbox directory called backup
|
|
|
|
|
|
|
|
|
|
rclone copy /home/source remote:backup
|
|
|
|
|
|
2018-05-28 17:50:31 +08:00
|
|
|
|
### Dropbox for business ###
|
|
|
|
|
|
|
|
|
|
Rclone supports Dropbox for business and Team Folders.
|
|
|
|
|
|
|
|
|
|
When using Dropbox for business `remote:` and `remote:path/to/file`
|
|
|
|
|
will refer to your personal folder.
|
|
|
|
|
|
|
|
|
|
If you wish to see Team Folders you must use a leading `/` in the
|
|
|
|
|
path, so `rclone lsd remote:/` will refer to the root and show you all
|
|
|
|
|
Team Folders and your User Folder.
|
|
|
|
|
|
|
|
|
|
You can then use team folders like this `remote:/TeamFolder` and
|
|
|
|
|
`remote:/TeamFolder/path/to/file`.
|
|
|
|
|
|
|
|
|
|
A leading `/` for a Dropbox personal account will do nothing, but it
|
|
|
|
|
will take an extra HTTP transaction so it should be avoided.
|
|
|
|
|
|
2017-05-26 22:09:31 +08:00
|
|
|
|
### Modified time and Hashes ###
|
2014-07-18 03:03:11 +08:00
|
|
|
|
|
2017-05-22 04:35:33 +08:00
|
|
|
|
Dropbox supports modified times, but the only way to set a
|
|
|
|
|
modification time is to re-upload the file.
|
|
|
|
|
|
|
|
|
|
This means that if you uploaded your data with an older version of
|
|
|
|
|
rclone which didn't support the v2 API and modified times, rclone will
|
|
|
|
|
decide to upload all your old data to fix the modification times. If
|
|
|
|
|
you don't want this to happen use `--size-only` or `--checksum` flag
|
|
|
|
|
to stop it.
|
2015-05-19 03:07:49 +08:00
|
|
|
|
|
2017-05-26 22:09:31 +08:00
|
|
|
|
Dropbox supports [its own hash
|
|
|
|
|
type](https://www.dropbox.com/developers/reference/content-hash) which
|
|
|
|
|
is checked for all transfers.
|
|
|
|
|
|
2018-11-02 20:14:02 +08:00
|
|
|
|
#### Restricted filename characters
|
|
|
|
|
|
|
|
|
|
| Character | Value | Replacement |
|
|
|
|
|
| --------- |:-----:|:-----------:|
|
|
|
|
|
| NUL | 0x00 | ␀ |
|
|
|
|
|
| / | 0x2F | / |
|
|
|
|
|
| DEL | 0x7F | ␡ |
|
|
|
|
|
| \ | 0x5C | \ |
|
|
|
|
|
|
|
|
|
|
File names can also not end with the following characters.
|
2020-05-26 07:30:30 +08:00
|
|
|
|
These only get replaced if they are the last character in the name:
|
2018-11-02 20:14:02 +08:00
|
|
|
|
|
|
|
|
|
| Character | Value | Replacement |
|
|
|
|
|
| --------- |:-----:|:-----------:|
|
|
|
|
|
| SP | 0x20 | ␠ |
|
|
|
|
|
|
|
|
|
|
Invalid UTF-8 bytes will also be [replaced](/overview/#invalid-utf8),
|
|
|
|
|
as they can't be used in JSON strings.
|
|
|
|
|
|
2020-05-22 19:22:52 +08:00
|
|
|
|
{{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/dropbox/dropbox.go then run make backenddocs" >}}
|
2018-10-02 03:48:54 +08:00
|
|
|
|
### Standard Options
|
|
|
|
|
|
|
|
|
|
Here are the standard options specific to dropbox (Dropbox).
|
|
|
|
|
|
|
|
|
|
#### --dropbox-client-id
|
|
|
|
|
|
|
|
|
|
Dropbox App Client Id
|
|
|
|
|
Leave blank normally.
|
|
|
|
|
|
|
|
|
|
- Config: client_id
|
|
|
|
|
- Env Var: RCLONE_DROPBOX_CLIENT_ID
|
|
|
|
|
- Type: string
|
|
|
|
|
- Default: ""
|
|
|
|
|
|
|
|
|
|
#### --dropbox-client-secret
|
|
|
|
|
|
|
|
|
|
Dropbox App Client Secret
|
|
|
|
|
Leave blank normally.
|
|
|
|
|
|
|
|
|
|
- Config: client_secret
|
|
|
|
|
- Env Var: RCLONE_DROPBOX_CLIENT_SECRET
|
|
|
|
|
- Type: string
|
|
|
|
|
- Default: ""
|
|
|
|
|
|
|
|
|
|
### Advanced Options
|
|
|
|
|
|
|
|
|
|
Here are the advanced options specific to dropbox (Dropbox).
|
|
|
|
|
|
|
|
|
|
#### --dropbox-chunk-size
|
|
|
|
|
|
|
|
|
|
Upload chunk size. (< 150M).
|
|
|
|
|
|
|
|
|
|
Any files larger than this will be uploaded in chunks of this size.
|
|
|
|
|
|
|
|
|
|
Note that chunks are buffered in memory (one at a time) so rclone can
|
|
|
|
|
deal with retries. Setting this larger will increase the speed
|
|
|
|
|
slightly (at most 10% for 128MB in tests) at the cost of using more
|
|
|
|
|
memory. It can be set smaller if you are tight on memory.
|
|
|
|
|
|
|
|
|
|
- Config: chunk_size
|
|
|
|
|
- Env Var: RCLONE_DROPBOX_CHUNK_SIZE
|
|
|
|
|
- Type: SizeSuffix
|
|
|
|
|
- Default: 48M
|
|
|
|
|
|
2018-11-24 21:44:25 +08:00
|
|
|
|
#### --dropbox-impersonate
|
|
|
|
|
|
|
|
|
|
Impersonate this user when using a business account.
|
|
|
|
|
|
|
|
|
|
- Config: impersonate
|
|
|
|
|
- Env Var: RCLONE_DROPBOX_IMPERSONATE
|
|
|
|
|
- Type: string
|
|
|
|
|
- Default: ""
|
|
|
|
|
|
2020-02-01 18:31:42 +08:00
|
|
|
|
#### --dropbox-encoding
|
|
|
|
|
|
|
|
|
|
This sets the encoding for the backend.
|
|
|
|
|
|
|
|
|
|
See: the [encoding section in the overview](/overview/#encoding) for more info.
|
|
|
|
|
|
|
|
|
|
- Config: encoding
|
|
|
|
|
- Env Var: RCLONE_DROPBOX_ENCODING
|
|
|
|
|
- Type: MultiEncoder
|
|
|
|
|
- Default: Slash,BackSlash,Del,RightSpace,InvalidUtf8,Dot
|
|
|
|
|
|
2020-05-22 19:22:52 +08:00
|
|
|
|
{{< rem autogenerated options stop >}}
|
2015-11-14 19:38:35 +08:00
|
|
|
|
|
2015-06-06 17:05:21 +08:00
|
|
|
|
### Limitations ###
|
2015-05-19 03:07:49 +08:00
|
|
|
|
|
2015-11-14 19:20:04 +08:00
|
|
|
|
Note that Dropbox is case insensitive so you can't have a file called
|
2015-07-31 03:26:29 +08:00
|
|
|
|
"Hello.doc" and one called "hello.doc".
|
2015-08-21 01:36:06 +08:00
|
|
|
|
|
|
|
|
|
There are some file names such as `thumbs.db` which Dropbox can't
|
|
|
|
|
store. There is a full list of them in the ["Ignored Files" section
|
|
|
|
|
of this document](https://www.dropbox.com/en/help/145). Rclone will
|
|
|
|
|
issue an error message `File name disallowed - not uploading` if it
|
2018-04-13 20:24:58 +08:00
|
|
|
|
attempts to upload one of those file names, but the sync won't fail.
|
2016-03-22 22:46:43 +08:00
|
|
|
|
|
|
|
|
|
If you have more than 10,000 files in a directory then `rclone purge
|
|
|
|
|
dropbox:dir` will return the error `Failed to purge: There are too
|
|
|
|
|
many files involved in this operation`. As a work-around do an
|
2017-04-24 23:38:49 +08:00
|
|
|
|
`rclone delete dropbox:dir` followed by an `rclone rmdir dropbox:dir`.
|
2019-10-29 00:49:16 +08:00
|
|
|
|
|
|
|
|
|
### Get your own Dropbox App ID ###
|
|
|
|
|
|
|
|
|
|
When you use rclone with Dropbox in its default configuration you are using rclone's App ID. This is shared between all the rclone users.
|
|
|
|
|
|
|
|
|
|
Here is how to create your own Dropbox App ID for rclone:
|
|
|
|
|
|
|
|
|
|
1. Log into the [Dropbox App console](https://www.dropbox.com/developers/apps/create) with your Dropbox Account (It need not
|
|
|
|
|
to be the same account as the Dropbox you want to access)
|
|
|
|
|
|
|
|
|
|
2. Choose an API => Usually this should be `Dropbox API`
|
|
|
|
|
|
2020-03-18 21:31:04 +08:00
|
|
|
|
3. Choose the type of access you want to use => `Full Dropbox` or `App Folder`
|
2019-10-29 00:49:16 +08:00
|
|
|
|
|
2020-03-18 21:31:04 +08:00
|
|
|
|
4. Name your App. The app name is global, so you can't use `rclone` for example
|
2019-10-29 00:49:16 +08:00
|
|
|
|
|
|
|
|
|
5. Click the button `Create App`
|
|
|
|
|
|
2020-03-18 21:31:04 +08:00
|
|
|
|
5. Fill `Redirect URIs` as `http://localhost:53682/`
|
|
|
|
|
|
2019-10-29 00:49:16 +08:00
|
|
|
|
6. Find the `App key` and `App secret` Use these values in rclone config to add a new remote or edit an existing remote.
|