v1.59

Combine

The combine backend joins remotes together into a single directory tree.

For example you might have a remote for images on one provider:

  1. $ rclone tree s3:imagesbucket
  2. /
  3. ├── image1.jpg
  4. └── image2.jpg

And a remote for files on another:

  1. $ rclone tree drive:important/files
  2. /
  3. ├── file1.txt
  4. └── file2.txt

The combine backend can join these together into a synthetic directory structure like this:

  1. $ rclone tree combined:
  2. /
  3. ├── files
  4. ├── file1.txt
  5. └── file2.txt
  6. └── images
  7. ├── image1.jpg
  8. └── image2.jpg

You’d do this by specifying an upstreams parameter in the config like this

  1. upstreams = images=s3:imagesbucket files=drive:important/files

During the initial setup with rclone config you will specify the upstreams remotes as a space separated list. The upstream remotes can either be a local paths or other remotes.

Configuration

Here is an example of how to make a combine called remote for the example above. First run:

  1. rclone config

This will guide you through an interactive setup process:

  1. No remotes found, make a new one?
  2. n) New remote
  3. s) Set configuration password
  4. q) Quit config
  5. n/s/q> n
  6. name> remote
  7. Option Storage.
  8. Type of storage to configure.
  9. Choose a number from below, or type in your own value.
  10. ...
  11. XX / Combine several remotes into one
  12. \ (combine)
  13. ...
  14. Storage> combine
  15. Option upstreams.
  16. Upstreams for combining
  17. These should be in the form
  18. dir=remote:path dir2=remote2:path
  19. Where before the = is specified the root directory and after is the remote to
  20. put there.
  21. Embedded spaces can be added using quotes
  22. "dir=remote:path with space" "dir2=remote2:path with space"
  23. Enter a fs.SpaceSepList value.
  24. upstreams> images=s3:imagesbucket files=drive:important/files
  25. Configuration complete.
  26. Options:
  27. - type: combine
  28. - upstreams: images=s3:imagesbucket files=drive:important/files
  29. Keep this "remote" remote?
  30. y) Yes this is OK (default)
  31. e) Edit this remote
  32. d) Delete this remote
  33. y/e/d> y

Configuring for Google Drive Shared Drives

Rclone has a convenience feature for making a combine backend for all the shared drives you have access to.

Assuming your main (non shared drive) Google drive remote is called drive: you would run

  1. rclone backend -o config drives drive:

This would produce something like this:

  1. [My Drive]
  2. type = alias
  3. remote = drive,team_drive=0ABCDEF-01234567890,root_folder_id=:
  4. [Test Drive]
  5. type = alias
  6. remote = drive,team_drive=0ABCDEFabcdefghijkl,root_folder_id=:
  7. [AllDrives]
  8. type = combine
  9. upstreams = "My Drive=My Drive:" "Test Drive=Test Drive:"

If you then add that config to your config file (find it with rclone config file) then you can access all the shared drives in one place with the AllDrives: remote.

See the Google Drive docs for full info.

Standard options

Here are the Standard options specific to combine (Combine several remotes into one).

--combine-upstreams

Upstreams for combining

These should be in the form

  1. dir=remote:path dir2=remote2:path

Where before the = is specified the root directory and after is the remote to put there.

Embedded spaces can be added using quotes

  1. "dir=remote:path with space" "dir2=remote2:path with space"

Properties:

  • Config: upstreams
  • Env Var: RCLONE_COMBINE_UPSTREAMS
  • Type: SpaceSepList
  • Default:

Advanced options

Here are the Advanced options specific to combine (Combine several remotes into one).

--combine-description

Description of the remote.

Properties:

  • Config: description
  • Env Var: RCLONE_COMBINE_DESCRIPTION
  • Type: string
  • Required: false

Metadata

Any metadata supported by the underlying remote is read and written.

See the metadata docs for more info.