feature request: exclude from path

Matt Stevens matt.w.stevens at gmail.com
Mon Aug 3 16:02:16 UTC 2020

Got it working properly. Many thanks!

Matt Stevens

On 8/3/20 10:28 AM, Paul Slootman via rsync wrote:
> On Mon 03 Aug 2020, Matt Stevens via rsync wrote:
>> So I've gotten excluding paths to work as a standalone command. When I paste
>> this into a script however, it ignores the exclusions. Any advice?
>> rsync -aXvr --times --links
>> --exclude={'*.vdi','*.vmdk','*.ova','*.qcow2','.config/discord/'}
>> /home/path/ user at nas:/NAS/HOME/destination/
>> Are there supposed to be some kind of brackets around this?
> Using these brackets with bash causes the --exclude to be repeated for
> each value:
> $ echo TEST: --exclude={'*.vdi','*.vmdk','*.ova','*.qcow2','.config/discord/'}
> TEST: --exclude=*.vdi --exclude=*.vmdk --exclude=*.ova --exclude=*.qcow2 --exclude=.config/discord/
> I suspect you've pasted this into a shell script which does not start
> with #!/bin/bash but perhaps #!/bin/sh so that the script is not run by
> bash but e.g. ash or dash that don't do the braces expansion.
> It's always best (especially in a script) to write it out, don't rely on
> the shell for such things.
> Paul

More information about the rsync mailing list