Skip to content

Commit 42f8386

Browse files
committed
Improve --mkpath a bit more.
1 parent ad6245f commit 42f8386

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

rsync.1.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ has its own detailed description later in this manpage.
436436
--append-verify --append w/old data in file checksum
437437
--dirs, -d transfer directories without recursing
438438
--old-dirs, --old-d works like --dirs when talking to old rsync
439-
--mkpath create the destination's path component
439+
--mkpath create destination's missing path components
440440
--links, -l copy symlinks as symlinks
441441
--copy-links, -L transform symlink into referent file/dir
442442
--copy-unsafe-links only "unsafe" symlinks are transformed
@@ -1149,23 +1149,25 @@ expand it.
11491149

11501150
0. `--mkpath`
11511151

1152-
Create a missing path component of the destination path. By default, rsync
1153-
allows only the final element of the destination path to not exist, which
1154-
is an attempt to help you to validate your destination path. With this
1155-
option, rsync creates all the missing destination-path components just as
1156-
if `mkdir -p $DEST_PATH` had been run.
1152+
Create all missing path components of the destination path.
1153+
1154+
By default, rsync allows only the final component of the destination path
1155+
to not exist, which is an attempt to help you to validate your destination
1156+
path. With this option, rsync creates all the missing destination-path
1157+
components, just as if `mkdir -p $DEST_PATH` had been run on the receiving
1158+
side.
11571159

11581160
When specifying a destination path, including a trailing slash ensures that
1159-
rsync always treats the whole path as the directory name to be created,
1160-
even if the source arg is a single filename. See the [COPYING TO A
1161-
DIFFERENT NAME](#) section for full details on how rsync decides if a final
1162-
destination path element is a directory element or not.
1161+
the whole path is treated as directory names to be created, even when the
1162+
file list has a single item. See the [COPYING TO A DIFFERENT NAME](#)
1163+
section for full details on how rsync decides if a final destination-path
1164+
component should be created as a directory or not.
11631165

11641166
If you would like the newly-created destination dirs to match the dirs on
11651167
the sending side, you should be using [`--relative`](#opt) (`-R`) instead
11661168
of `--mkpath`. For instance, the following two commands result in the same
1167-
destination tree, but it is only the second command that ensures that the
1168-
"some/extra/path" elements match the dirs on the sending side:
1169+
destination tree, but only the second command ensures that the
1170+
"some/extra/path" components match the dirs on the sending side:
11691171

11701172
> rsync -ai --mkpath host:some/extra/path/*.c some/extra/path/
11711173
> rsync -aiR host:some/extra/path/*.c ./

0 commit comments

Comments
 (0)