rsync
rsync copied to clipboard
Glob expansion also returns nonexisting paths
With a structure created like this:
mkdir a b
touch a/file
Expansion of */file
results in a/file b/file
, but the latter does not exist. This leads to errors like this:
> rsync -s --list-only --port=8730 localhost::tmp/*/foo
rsync: [sender] link_stat "/b/foo" (in tmp) failed: No such file or directory (2)
-rw-r--r-- 0 2020/12/16 12:28:52 foo
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1832) [generator=3.2.3]
I believe this is because when glob_match
sees a path component without any of *?[
inside, it uses that directly.
It can be worked around by also including a wildcard in the last component of the path, e.g.
> rsync -s --list-only --port=8730 'localhost::tmp/*/[f]oo'
-rw-r--r-- 0 2020/12/16 12:28:52 foo