Copying one directory tree to another but exclude all top-level files
Kevin Korb
kmk at sanitarium.net
Fri Jan 30 15:37:13 UTC 2026
That looks right to me.
If you want the files within the dirs you ca:
--include='/*/***' --exclude='/*'
On 2026-01-30 10:19, Paul Slootman via rsync wrote:
> On Fri 30 Jan 2026, Brian J. Murrell via rsync wrote:
>> On Fri, 2026-01-30 at 08:56 -0500, Kevin Korb via rsync wrote:
>>> It sounds like you want: --include='/*' --exclude='/*/'
>> No. That doesn't work either.
> I think Kevin got it the wrong way round.
> You first need to include all directories on the root level,
> then exclude all the rest on the root level:
>
> --include='/*/' --exclude='/*'
>
>
> Paul
>
More information about the rsync
mailing list