2014-04-24 19:11:08 +02:00
|
|
|
|
---
|
|
|
|
|
title: "Local Filesystem"
|
|
|
|
|
description: "Rclone docs for the local filesystem"
|
2014-04-26 18:43:41 +02:00
|
|
|
|
date: "2014-04-26"
|
2014-04-24 19:11:08 +02:00
|
|
|
|
---
|
|
|
|
|
|
2014-07-17 21:03:11 +02:00
|
|
|
|
<i class="fa fa-file"></i> Local Filesystem
|
|
|
|
|
-------------------------------------------
|
2014-03-28 23:34:13 +01:00
|
|
|
|
|
|
|
|
|
Local paths are specified as normal filesystem paths, eg `/path/to/wherever`, so
|
|
|
|
|
|
|
|
|
|
rclone sync /home/source /tmp/destination
|
|
|
|
|
|
|
|
|
|
Will sync `/home/source` to `/tmp/destination`
|
|
|
|
|
|
|
|
|
|
These can be configured into the config file for consistencies sake,
|
|
|
|
|
but it is probably easier not to.
|
|
|
|
|
|
2015-06-06 11:05:21 +02:00
|
|
|
|
### Modified time ###
|
2014-03-28 23:34:13 +01:00
|
|
|
|
|
2014-04-26 18:43:41 +02:00
|
|
|
|
Rclone reads and writes the modified time using an accuracy determined by
|
2014-03-28 23:34:13 +01:00
|
|
|
|
the OS. Typically this is 1ns on Linux, 10 ns on Windows and 1 Second
|
|
|
|
|
on OS X.
|
|
|
|
|
|
2015-06-06 11:05:21 +02:00
|
|
|
|
### Filenames ###
|
2015-05-21 19:40:16 +02:00
|
|
|
|
|
|
|
|
|
Filenames are expected to be encoded in UTF-8 on disk. This is the
|
2016-02-21 15:09:06 +01:00
|
|
|
|
normal case for Windows and OS X.
|
|
|
|
|
|
|
|
|
|
There is a bit more uncertainty in the Linux world, but new
|
|
|
|
|
distributions will have UTF-8 encoded files names. If you are using an
|
|
|
|
|
old Linux filesystem with non UTF-8 file names (eg latin1) then you
|
|
|
|
|
can use the `convmv` tool to convert the filesystem to UTF-8. This
|
|
|
|
|
tool is available in most distributions' package managers.
|
2015-05-21 19:40:16 +02:00
|
|
|
|
|
2017-10-28 08:03:51 +02:00
|
|
|
|
If an invalid (non-UTF8) filename is read, the invalid characters will
|
2015-05-21 19:40:16 +02:00
|
|
|
|
be replaced with the unicode replacement character, '<27>'. `rclone`
|
2015-06-06 11:05:21 +02:00
|
|
|
|
will emit a debug message in this case (use `-v` to see), eg
|
2015-05-21 19:40:16 +02:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Local file system at .: Replacing invalid UTF-8 characters in "gro\xdf"
|
|
|
|
|
```
|
2016-01-04 12:28:47 +01:00
|
|
|
|
|
|
|
|
|
### Long paths on Windows ###
|
|
|
|
|
|
|
|
|
|
Rclone handles long paths automatically, by converting all paths to long
|
|
|
|
|
[UNC paths](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath)
|
|
|
|
|
which allows paths up to 32,767 characters.
|
|
|
|
|
|
|
|
|
|
This is why you will see that your paths, for instance `c:\files` is
|
|
|
|
|
converted to the UNC path `\\?\c:\files` in the output,
|
|
|
|
|
and `\\server\share` is converted to `\\?\UNC\server\share`.
|
|
|
|
|
|
|
|
|
|
However, in rare cases this may cause problems with buggy file
|
|
|
|
|
system drivers like [EncFS](https://github.com/ncw/rclone/issues/261).
|
|
|
|
|
To disable UNC conversion globally, add this to your `.rclone.conf` file:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[local]
|
|
|
|
|
nounc = true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If you want to selectively disable UNC, you can add it to a separate entry like this:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[nounc]
|
|
|
|
|
type = local
|
|
|
|
|
nounc = true
|
|
|
|
|
```
|
|
|
|
|
And use rclone like this:
|
|
|
|
|
|
|
|
|
|
`rclone copy c:\src nounc:z:\dst`
|
|
|
|
|
|
|
|
|
|
This will use UNC paths on `c:\src` but not on `z:\dst`.
|
|
|
|
|
Of course this will cause problems if the absolute path length of a
|
|
|
|
|
file exceeds 258 characters on z, so only use this option if you have to.
|
2016-11-03 12:51:36 +01:00
|
|
|
|
|
|
|
|
|
### Specific options ###
|
|
|
|
|
|
|
|
|
|
Here are the command line options specific to local storage
|
|
|
|
|
|
2017-01-29 14:43:20 +01:00
|
|
|
|
#### --copy-links, -L ####
|
|
|
|
|
|
|
|
|
|
Normally rclone will ignore symlinks or junction points (which behave
|
|
|
|
|
like symlinks under Windows).
|
|
|
|
|
|
|
|
|
|
If you supply this flag then rclone will follow the symlink and copy
|
|
|
|
|
the pointed to file or directory.
|
|
|
|
|
|
|
|
|
|
This flag applies to all commands.
|
|
|
|
|
|
|
|
|
|
For example, supposing you have a directory structure like this
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ tree /tmp/a
|
|
|
|
|
/tmp/a
|
|
|
|
|
├── b -> ../b
|
|
|
|
|
├── expected -> ../expected
|
|
|
|
|
├── one
|
|
|
|
|
└── two
|
|
|
|
|
└── three
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then you can see the difference with and without the flag like this
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ rclone ls /tmp/a
|
|
|
|
|
6 one
|
|
|
|
|
6 two/three
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
and
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ rclone -L ls /tmp/a
|
|
|
|
|
4174 expected
|
|
|
|
|
6 one
|
|
|
|
|
6 two/three
|
|
|
|
|
6 b/two
|
|
|
|
|
6 b/one
|
|
|
|
|
```
|
|
|
|
|
|
2017-08-31 13:34:29 +02:00
|
|
|
|
#### --local-no-unicode-normalization ####
|
2017-05-19 03:04:22 +02:00
|
|
|
|
|
2017-09-08 17:19:41 +02:00
|
|
|
|
This flag is deprecated now. Rclone no longer normalizes unicode file
|
|
|
|
|
names, but it compares them with unicode normalization in the sync
|
|
|
|
|
routine instead.
|
2017-05-19 03:04:22 +02:00
|
|
|
|
|
2016-11-03 12:51:36 +01:00
|
|
|
|
#### --one-file-system, -x ####
|
|
|
|
|
|
|
|
|
|
This tells rclone to stay in the filesystem specified by the root and
|
|
|
|
|
not to recurse into different file systems.
|
|
|
|
|
|
2017-10-28 08:03:51 +02:00
|
|
|
|
For example if you have a directory hierarchy like this
|
2016-11-03 12:51:36 +01:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
root
|
|
|
|
|
├── disk1 - disk1 mounted on the root
|
|
|
|
|
│ └── file3 - stored on disk1
|
|
|
|
|
├── disk2 - disk2 mounted on the root
|
|
|
|
|
│ └── file4 - stored on disk12
|
|
|
|
|
├── file1 - stored on the root disk
|
|
|
|
|
└── file2 - stored on the root disk
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Using `rclone --one-file-system copy root remote:` will only copy `file1` and `file2`. Eg
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ rclone -q --one-file-system ls root
|
|
|
|
|
0 file1
|
|
|
|
|
0 file2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ rclone -q ls root
|
|
|
|
|
0 disk1/file3
|
|
|
|
|
0 disk2/file4
|
|
|
|
|
0 file1
|
|
|
|
|
0 file2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**NB** Rclone (like most unix tools such as `du`, `rsync` and `tar`)
|
|
|
|
|
treats a bind mount to the same device as being on the same
|
|
|
|
|
filesystem.
|
|
|
|
|
|
|
|
|
|
**NB** This flag is only available on Unix based systems. On systems
|
|
|
|
|
where it isn't supported (eg Windows) it will not appear as an valid
|
|
|
|
|
flag.
|
2017-07-21 12:15:58 +02:00
|
|
|
|
|
|
|
|
|
#### --skip-links ####
|
|
|
|
|
|
|
|
|
|
This flag disables warning messages on skipped symlinks or junction
|
|
|
|
|
points, as you explicitly acknowledge that they should be skipped.
|