protecting files from deletion, and using --delete-excluded

Christophe LYON christophe.lyon at
Tue Aug 29 17:10:01 GMT 2006

Hi all,

I am trying to write a script based on rsync to help users select what 
they want to mirror, what they want to skip and what they want to delete 
on the remote side.

Let's say that I have 1 directory per release:
r1.0 r1.1 r2.0 r2.1 r3.1 r3.2 r4.0 r4.1

At some point I have mirrored all of them, but now I want to be able to 
tell rsync to:
- remove all r1.* and r2.* releases
- skip r3.* releases (ie don't scan them, but don't delete them)
- sync r4.* releases

I am trying to use filters:
+ /r4*/
P /r3*/
+ /some-other-dir/
- /* (to remove r1*,r2* but also every thing else I don't want)

What I see is that rsync wants to remove all my r3* dirs, while I 
thought I had protected them.

I have read several time the filters documentation but can't figure out 
what's going on ? Even reading the sources of generator.c didn't help 
much :-(



More information about the rsync mailing list