Yet another filter question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Yet another filter question

Samba - rsync mailing list
Given the structure…
/foo/bar/want-this.txt
/foo/bar/want-this-2.txt
/bar/foo/
/do-not-want-to-transfer/test.txt

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
include!
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
do?
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.

https://stackoverflow.com/questions/46925606/rsync-greedy-include



--
Sent from: http://samba.2283325.n4.nabble.com/Samba-rsync-f2500462.html

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

Re: Yet another filter question

Samba - rsync mailing list
If a directory is empty (after filtering) then --prune-empty-dirs prunes
it.  That is the point.  The option exists to keep rsync from copying
directories when all of the contents of the directory have been filtered
out.

On 10/25/2017 10:09 PM, dave_g via rsync wrote:

> Given the structure…
> /foo/bar/want-this.txt
> /foo/bar/want-this-2.txt
> /bar/foo/
> /do-not-want-to-transfer/test.txt
>
> 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
> include!
> 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
> do?
> 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.
>
> https://stackoverflow.com/questions/46925606/rsync-greedy-include
>
>
>
> --
> Sent from: http://samba.2283325.n4.nabble.com/Samba-rsync-f2500462.html
>
--
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
        Kevin Korb Phone:    (407) 252-6853
        Systems Administrator Internet:
        FutureQuest, Inc. [hidden email]  (work)
        Orlando, Florida [hidden email] (personal)
        Web page: http://www.sanitarium.net/
        PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,


--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

signature.asc (231 bytes) Download Attachment