[colug-432] rsync include/exclude

Rick Hornsby richardjhornsby at gmail.com
Wed Mar 4 11:50:38 EST 2015



> On Mar 4, 2015, at 10:28, Jeff Frontz <jeff.frontz at gmail.com> wrote:
> 
> Sounds like your "pat[1-N]" aren't specific enough --  please provide
> the exact command, list of files on the source, output from rsync, and
> indications of what files you didn't want.

I have to type this out on my phone by hand since my work computer has limited interwebs access.

After studying the rsync debug output a little more while trying to retype it here, I saw the error was that rsync was taking an include pattern with literal quotes wrapped around it.

I'll try to type up a better explanation when I have a real keyboard.

It was another escape gotcha that happens when you're working in a shell script vs directly on a shell prompt.

-rj







> 
> Thanks,
> Jeff
> 
> 
>> On Wed, Mar 4, 2015 at 11:11 AM, Rick Hornsby <richardjhornsby at gmail.com> wrote:
>> Trying to sort out how to properly use rsync to copy only certain files.  Most resources, including the man page, seem to say
>> 
>> rsync --include="*/" --include=pat1 --include=pat2 --include=patN --exclude="*"
>> 
>> However, I'm finding that rsync seems to be using the final exclude to override the previous includes.
>> 
>> "[sender] hiding file X because of pattern *"
>> 
>> So far everything I can find (including the manpage) says to use that order (exclude last).  If I remove the exclude, the files I want - and more - are included.  That is, instead of hiding the files it pretends (dry-run) to send them.
>> 
>> Also, I'm using
>> 
>> rsync -a -vvv --dry-run ...
>> 
>> thanks
>> 
>> Sent from my iPhone
>> _______________________________________________
>> colug-432 mailing list
>> colug-432 at colug.net
>> http://lists.colug.net/mailman/listinfo/colug-432
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432



More information about the colug-432 mailing list