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