github.com/ncw/rclone@v1.48.1-0.20190724201158-a35aa1360e3e/docs/content/union.md (about) 1 --- 2 title: "Union" 3 description: "Remote Unification" 4 date: "2018-08-29" 5 --- 6 7 <i class="fa fa-link"></i> Union 8 ----------------------------------------- 9 10 The `union` remote provides a unification similar to UnionFS using other remotes. 11 12 Paths may be as deep as required or a local path, 13 eg `remote:directory/subdirectory` or `/directory/subdirectory`. 14 15 During the initial setup with `rclone config` you will specify the target 16 remotes as a space separated list. The target remotes can either be a local paths or other remotes. 17 18 The order of the remotes is important as it defines which remotes take precedence over others if there are files with the same name in the same logical path. 19 The last remote is the topmost remote and replaces files with the same name from previous remotes. 20 21 Only the last remote is used to write to and delete from, all other remotes are read-only. 22 23 Subfolders can be used in target remote. Assume a union remote named `backup` 24 with the remotes `mydrive:private/backup mydrive2:/backup`. Invoking `rclone mkdir backup:desktop` 25 is exactly the same as invoking `rclone mkdir mydrive2:/backup/desktop`. 26 27 There will be no special handling of paths containing `..` segments. 28 Invoking `rclone mkdir backup:../desktop` is exactly the same as invoking 29 `rclone mkdir mydrive2:/backup/../desktop`. 30 31 Here is an example of how to make a union called `remote` for local folders. 32 First run: 33 34 rclone config 35 36 This will guide you through an interactive setup process: 37 38 ``` 39 No remotes found - make a new one 40 n) New remote 41 s) Set configuration password 42 q) Quit config 43 n/s/q> n 44 name> remote 45 Type of storage to configure. 46 Choose a number from below, or type in your own value 47 1 / Alias for an existing remote 48 \ "alias" 49 2 / Amazon Drive 50 \ "amazon cloud drive" 51 3 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio) 52 \ "s3" 53 4 / Backblaze B2 54 \ "b2" 55 5 / Box 56 \ "box" 57 6 / Builds a stackable unification remote, which can appear to merge the contents of several remotes 58 \ "union" 59 7 / Cache a remote 60 \ "cache" 61 8 / Dropbox 62 \ "dropbox" 63 9 / Encrypt/Decrypt a remote 64 \ "crypt" 65 10 / FTP Connection 66 \ "ftp" 67 11 / Google Cloud Storage (this is not Google Drive) 68 \ "google cloud storage" 69 12 / Google Drive 70 \ "drive" 71 13 / Hubic 72 \ "hubic" 73 14 / JottaCloud 74 \ "jottacloud" 75 15 / Local Disk 76 \ "local" 77 16 / Mega 78 \ "mega" 79 17 / Microsoft Azure Blob Storage 80 \ "azureblob" 81 18 / Microsoft OneDrive 82 \ "onedrive" 83 19 / OpenDrive 84 \ "opendrive" 85 20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH) 86 \ "swift" 87 21 / Pcloud 88 \ "pcloud" 89 22 / QingCloud Object Storage 90 \ "qingstor" 91 23 / SSH/SFTP Connection 92 \ "sftp" 93 24 / Webdav 94 \ "webdav" 95 25 / Yandex Disk 96 \ "yandex" 97 26 / http Connection 98 \ "http" 99 Storage> union 100 List of space separated remotes. 101 Can be 'remotea:test/dir remoteb:', '"remotea:test/space dir" remoteb:', etc. 102 The last remote is used to write to. 103 Enter a string value. Press Enter for the default (""). 104 remotes> 105 Remote config 106 -------------------- 107 [remote] 108 type = union 109 remotes = C:\dir1 C:\dir2 C:\dir3 110 -------------------- 111 y) Yes this is OK 112 e) Edit this remote 113 d) Delete this remote 114 y/e/d> y 115 Current remotes: 116 117 Name Type 118 ==== ==== 119 remote union 120 121 e) Edit existing remote 122 n) New remote 123 d) Delete remote 124 r) Rename remote 125 c) Copy remote 126 s) Set configuration password 127 q) Quit config 128 e/n/d/r/c/s/q> q 129 ``` 130 131 Once configured you can then use `rclone` like this, 132 133 List directories in top level in `C:\dir1`, `C:\dir2` and `C:\dir3` 134 135 rclone lsd remote: 136 137 List all the files in `C:\dir1`, `C:\dir2` and `C:\dir3` 138 139 rclone ls remote: 140 141 Copy another local directory to the union directory called source, which will be placed into `C:\dir3` 142 143 rclone copy C:\source remote:source 144 145 <!--- autogenerated options start - DO NOT EDIT, instead edit fs.RegInfo in backend/union/union.go then run make backenddocs --> 146 ### Standard Options 147 148 Here are the standard options specific to union (A stackable unification remote, which can appear to merge the contents of several remotes). 149 150 #### --union-remotes 151 152 List of space separated remotes. 153 Can be 'remotea:test/dir remoteb:', '"remotea:test/space dir" remoteb:', etc. 154 The last remote is used to write to. 155 156 - Config: remotes 157 - Env Var: RCLONE_UNION_REMOTES 158 - Type: string 159 - Default: "" 160 161 <!--- autogenerated options stop -->