github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/local.md (about) 1 --- 2 title: "Local Filesystem" 3 description: "Rclone docs for the local filesystem" 4 --- 5 6 {{< icon "fas fa-hdd" >}} Local Filesystem 7 ------------------------------------------- 8 9 Local paths are specified as normal filesystem paths, eg `/path/to/wherever`, so 10 11 rclone sync /home/source /tmp/destination 12 13 Will sync `/home/source` to `/tmp/destination` 14 15 These can be configured into the config file for consistencies sake, 16 but it is probably easier not to. 17 18 ### Modified time ### 19 20 Rclone reads and writes the modified time using an accuracy determined by 21 the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second 22 on OS X. 23 24 ### Filenames ### 25 26 Filenames should be encoded in UTF-8 on disk. This is the normal case 27 for Windows and OS X. 28 29 There is a bit more uncertainty in the Linux world, but new 30 distributions will have UTF-8 encoded files names. If you are using an 31 old Linux filesystem with non UTF-8 file names (eg latin1) then you 32 can use the `convmv` tool to convert the filesystem to UTF-8. This 33 tool is available in most distributions' package managers. 34 35 If an invalid (non-UTF8) filename is read, the invalid characters will 36 be replaced with a quoted representation of the invalid bytes. The name 37 `gro\xdf` will be transferred as `gro‛DF`. `rclone` will emit a debug 38 message in this case (use `-v` to see), eg 39 40 ``` 41 Local file system at .: Replacing invalid UTF-8 characters in "gro\xdf" 42 ``` 43 44 #### Restricted characters 45 46 On non Windows platforms the following characters are replaced when 47 handling file names. 48 49 | Character | Value | Replacement | 50 | --------- |:-----:|:-----------:| 51 | NUL | 0x00 | ␀ | 52 | / | 0x2F | / | 53 54 When running on Windows the following characters are replaced. This 55 list is based on the [Windows file naming conventions](https://docs.microsoft.com/de-de/windows/desktop/FileIO/naming-a-file#naming-conventions). 56 57 | Character | Value | Replacement | 58 | --------- |:-----:|:-----------:| 59 | NUL | 0x00 | ␀ | 60 | SOH | 0x01 | ␁ | 61 | STX | 0x02 | ␂ | 62 | ETX | 0x03 | ␃ | 63 | EOT | 0x04 | ␄ | 64 | ENQ | 0x05 | ␅ | 65 | ACK | 0x06 | ␆ | 66 | BEL | 0x07 | ␇ | 67 | BS | 0x08 | ␈ | 68 | HT | 0x09 | ␉ | 69 | LF | 0x0A | ␊ | 70 | VT | 0x0B | ␋ | 71 | FF | 0x0C | ␌ | 72 | CR | 0x0D | ␍ | 73 | SO | 0x0E | ␎ | 74 | SI | 0x0F | ␏ | 75 | DLE | 0x10 | ␐ | 76 | DC1 | 0x11 | ␑ | 77 | DC2 | 0x12 | ␒ | 78 | DC3 | 0x13 | ␓ | 79 | DC4 | 0x14 | ␔ | 80 | NAK | 0x15 | ␕ | 81 | SYN | 0x16 | ␖ | 82 | ETB | 0x17 | ␗ | 83 | CAN | 0x18 | ␘ | 84 | EM | 0x19 | ␙ | 85 | SUB | 0x1A | ␚ | 86 | ESC | 0x1B | ␛ | 87 | FS | 0x1C | ␜ | 88 | GS | 0x1D | ␝ | 89 | RS | 0x1E | ␞ | 90 | US | 0x1F | ␟ | 91 | / | 0x2F | / | 92 | " | 0x22 | " | 93 | * | 0x2A | * | 94 | : | 0x3A | : | 95 | < | 0x3C | < | 96 | > | 0x3E | > | 97 | ? | 0x3F | ? | 98 | \ | 0x5C | \ | 99 | \| | 0x7C | | | 100 101 File names on Windows can also not end with the following characters. 102 These only get replaced if they are the last character in the name: 103 104 | Character | Value | Replacement | 105 | --------- |:-----:|:-----------:| 106 | SP | 0x20 | ␠ | 107 | . | 0x2E | . | 108 109 Invalid UTF-8 bytes will also be [replaced](/overview/#invalid-utf8), 110 as they can't be converted to UTF-16. 111 112 ### Long paths on Windows ### 113 114 Rclone handles long paths automatically, by converting all paths to long 115 [UNC paths](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath) 116 which allows paths up to 32,767 characters. 117 118 This is why you will see that your paths, for instance `c:\files` is 119 converted to the UNC path `\\?\c:\files` in the output, 120 and `\\server\share` is converted to `\\?\UNC\server\share`. 121 122 However, in rare cases this may cause problems with buggy file 123 system drivers like [EncFS](https://github.com/rclone/rclone/issues/261). 124 To disable UNC conversion globally, add this to your `.rclone.conf` file: 125 126 ``` 127 [local] 128 nounc = true 129 ``` 130 131 If you want to selectively disable UNC, you can add it to a separate entry like this: 132 133 ``` 134 [nounc] 135 type = local 136 nounc = true 137 ``` 138 And use rclone like this: 139 140 `rclone copy c:\src nounc:z:\dst` 141 142 This will use UNC paths on `c:\src` but not on `z:\dst`. 143 Of course this will cause problems if the absolute path length of a 144 file exceeds 258 characters on z, so only use this option if you have to. 145 146 ### Symlinks / Junction points 147 148 Normally rclone will ignore symlinks or junction points (which behave 149 like symlinks under Windows). 150 151 If you supply `--copy-links` or `-L` then rclone will follow the 152 symlink and copy the pointed to file or directory. Note that this 153 flag is incompatible with `-links` / `-l`. 154 155 This flag applies to all commands. 156 157 For example, supposing you have a directory structure like this 158 159 ``` 160 $ tree /tmp/a 161 /tmp/a 162 ├── b -> ../b 163 ├── expected -> ../expected 164 ├── one 165 └── two 166 └── three 167 ``` 168 169 Then you can see the difference with and without the flag like this 170 171 ``` 172 $ rclone ls /tmp/a 173 6 one 174 6 two/three 175 ``` 176 177 and 178 179 ``` 180 $ rclone -L ls /tmp/a 181 4174 expected 182 6 one 183 6 two/three 184 6 b/two 185 6 b/one 186 ``` 187 188 #### --links, -l 189 190 Normally rclone will ignore symlinks or junction points (which behave 191 like symlinks under Windows). 192 193 If you supply this flag then rclone will copy symbolic links from the local storage, 194 and store them as text files, with a '.rclonelink' suffix in the remote storage. 195 196 The text file will contain the target of the symbolic link (see example). 197 198 This flag applies to all commands. 199 200 For example, supposing you have a directory structure like this 201 202 ``` 203 $ tree /tmp/a 204 /tmp/a 205 ├── file1 -> ./file4 206 └── file2 -> /home/user/file3 207 ``` 208 209 Copying the entire directory with '-l' 210 211 ``` 212 $ rclone copyto -l /tmp/a/file1 remote:/tmp/a/ 213 ``` 214 215 The remote files are created with a '.rclonelink' suffix 216 217 ``` 218 $ rclone ls remote:/tmp/a 219 5 file1.rclonelink 220 14 file2.rclonelink 221 ``` 222 223 The remote files will contain the target of the symbolic links 224 225 ``` 226 $ rclone cat remote:/tmp/a/file1.rclonelink 227 ./file4 228 229 $ rclone cat remote:/tmp/a/file2.rclonelink 230 /home/user/file3 231 ``` 232 233 Copying them back with '-l' 234 235 ``` 236 $ rclone copyto -l remote:/tmp/a/ /tmp/b/ 237 238 $ tree /tmp/b 239 /tmp/b 240 ├── file1 -> ./file4 241 └── file2 -> /home/user/file3 242 ``` 243 244 However, if copied back without '-l' 245 246 ``` 247 $ rclone copyto remote:/tmp/a/ /tmp/b/ 248 249 $ tree /tmp/b 250 /tmp/b 251 ├── file1.rclonelink 252 └── file2.rclonelink 253 ```` 254 255 Note that this flag is incompatible with `-copy-links` / `-L`. 256 257 ### Restricting filesystems with --one-file-system 258 259 Normally rclone will recurse through filesystems as mounted. 260 261 However if you set `--one-file-system` or `-x` this tells rclone to 262 stay in the filesystem specified by the root and not to recurse into 263 different file systems. 264 265 For example if you have a directory hierarchy like this 266 267 ``` 268 root 269 ├── disk1 - disk1 mounted on the root 270 │ └── file3 - stored on disk1 271 ├── disk2 - disk2 mounted on the root 272 │ └── file4 - stored on disk12 273 ├── file1 - stored on the root disk 274 └── file2 - stored on the root disk 275 ``` 276 277 Using `rclone --one-file-system copy root remote:` will only copy `file1` and `file2`. Eg 278 279 ``` 280 $ rclone -q --one-file-system ls root 281 0 file1 282 0 file2 283 ``` 284 285 ``` 286 $ rclone -q ls root 287 0 disk1/file3 288 0 disk2/file4 289 0 file1 290 0 file2 291 ``` 292 293 **NB** Rclone (like most unix tools such as `du`, `rsync` and `tar`) 294 treats a bind mount to the same device as being on the same 295 filesystem. 296 297 **NB** This flag is only available on Unix based systems. On systems 298 where it isn't supported (eg Windows) it will be ignored. 299 300 {{< rem autogenerated options start" - DO NOT EDIT - instead edit fs.RegInfo in backend/local/local.go then run make backenddocs" >}} 301 ### Standard Options 302 303 Here are the standard options specific to local (Local Disk). 304 305 #### --local-nounc 306 307 Disable UNC (long path names) conversion on Windows 308 309 - Config: nounc 310 - Env Var: RCLONE_LOCAL_NOUNC 311 - Type: string 312 - Default: "" 313 - Examples: 314 - "true" 315 - Disables long file names 316 317 ### Advanced Options 318 319 Here are the advanced options specific to local (Local Disk). 320 321 #### --copy-links / -L 322 323 Follow symlinks and copy the pointed to item. 324 325 - Config: copy_links 326 - Env Var: RCLONE_LOCAL_COPY_LINKS 327 - Type: bool 328 - Default: false 329 330 #### --links / -l 331 332 Translate symlinks to/from regular files with a '.rclonelink' extension 333 334 - Config: links 335 - Env Var: RCLONE_LOCAL_LINKS 336 - Type: bool 337 - Default: false 338 339 #### --skip-links 340 341 Don't warn about skipped symlinks. 342 This flag disables warning messages on skipped symlinks or junction 343 points, as you explicitly acknowledge that they should be skipped. 344 345 - Config: skip_links 346 - Env Var: RCLONE_LOCAL_SKIP_LINKS 347 - Type: bool 348 - Default: false 349 350 #### --local-no-unicode-normalization 351 352 Don't apply unicode normalization to paths and filenames (Deprecated) 353 354 This flag is deprecated now. Rclone no longer normalizes unicode file 355 names, but it compares them with unicode normalization in the sync 356 routine instead. 357 358 - Config: no_unicode_normalization 359 - Env Var: RCLONE_LOCAL_NO_UNICODE_NORMALIZATION 360 - Type: bool 361 - Default: false 362 363 #### --local-no-check-updated 364 365 Don't check to see if the files change during upload 366 367 Normally rclone checks the size and modification time of files as they 368 are being uploaded and aborts with a message which starts "can't copy 369 - source file is being updated" if the file changes during upload. 370 371 However on some file systems this modification time check may fail (eg 372 [Glusterfs #2206](https://github.com/rclone/rclone/issues/2206)) so this 373 check can be disabled with this flag. 374 375 - Config: no_check_updated 376 - Env Var: RCLONE_LOCAL_NO_CHECK_UPDATED 377 - Type: bool 378 - Default: false 379 380 #### --one-file-system / -x 381 382 Don't cross filesystem boundaries (unix/macOS only). 383 384 - Config: one_file_system 385 - Env Var: RCLONE_LOCAL_ONE_FILE_SYSTEM 386 - Type: bool 387 - Default: false 388 389 #### --local-case-sensitive 390 391 Force the filesystem to report itself as case sensitive. 392 393 Normally the local backend declares itself as case insensitive on 394 Windows/macOS and case sensitive for everything else. Use this flag 395 to override the default choice. 396 397 - Config: case_sensitive 398 - Env Var: RCLONE_LOCAL_CASE_SENSITIVE 399 - Type: bool 400 - Default: false 401 402 #### --local-case-insensitive 403 404 Force the filesystem to report itself as case insensitive 405 406 Normally the local backend declares itself as case insensitive on 407 Windows/macOS and case sensitive for everything else. Use this flag 408 to override the default choice. 409 410 - Config: case_insensitive 411 - Env Var: RCLONE_LOCAL_CASE_INSENSITIVE 412 - Type: bool 413 - Default: false 414 415 #### --local-no-sparse 416 417 Disable sparse files for multi-thread downloads 418 419 On Windows platforms rclone will make sparse files when doing 420 multi-thread downloads. This avoids long pauses on large files where 421 the OS zeros the file. However sparse files may be undesirable as they 422 cause disk fragmentation and can be slow to work with. 423 424 - Config: no_sparse 425 - Env Var: RCLONE_LOCAL_NO_SPARSE 426 - Type: bool 427 - Default: false 428 429 #### --local-encoding 430 431 This sets the encoding for the backend. 432 433 See: the [encoding section in the overview](/overview/#encoding) for more info. 434 435 - Config: encoding 436 - Env Var: RCLONE_LOCAL_ENCODING 437 - Type: MultiEncoder 438 - Default: Slash,Dot 439 440 ### Backend commands 441 442 Here are the commands specific to the local backend. 443 444 Run them with 445 446 rclone backend COMMAND remote: 447 448 The help below will explain what arguments each command takes. 449 450 See [the "rclone backend" command](/commands/rclone_backend/) for more 451 info on how to pass options and arguments. 452 453 These can be run on a running backend using the rc command 454 [backend/command](/rc/#backend/command). 455 456 #### noop 457 458 A null operation for testing backend commands 459 460 rclone backend noop remote: [options] [<arguments>+] 461 462 This is a test command which has some options 463 you can try to change the output. 464 465 Options: 466 467 - "echo": echo the input arguments 468 - "error": return an error based on option value 469 470 {{< rem autogenerated options stop >}}