Yet another filter question

dave_g info at
Thu Oct 26 02:09:30 UTC 2017

Given the structure…

With the desire to ‘include items with foo in their path’...
I understand that the closest I can get to a satisfactory filter ruleset is
something like:
+ **foo**
+ */
- *
… and setting --prune-empty-dirs.

However, /bar/foo/ is empty, and of course should be copied.. but is pruned.
The source and pattern are user-defined, so I can’t hardcode values to
I can’t rely on other external binaries, so I can’t use $ find, or even
shell glob expansion (I call rsync directly, not through a shell).

Given these constraints, is the caveated --prune-empty-dirs the best I can
I mean it's pretty-darned-close, but just checking I'm not missing some
option to prevent the premature short-circuiting of recursion, or something
like that.

Sent from:

More information about the rsync mailing list