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

Christophe LYON christophe.lyon at st.com
Mon Sep 4 17:18:51 GMT 2006


Matt,

It seems that the problem is not really solved :-(

If I understand correctly, I have to send the filter file to the 
receiver, so that it can be used for deletion phase, right?
So I added --filter='+ /rsync-filter' to my options.

That is, I start
rsync -rltgoDuvR --delete-after --delete-excluded --filter='+ 
/rsync-filter' --filter=': ./rsync-filter

My top-level rsync-filter contains:
- /r4*/
P /r3*
+ /some-other-dir/
- /*

Now, none of /r3* and /r4* is deleted, why?

If I restart the same command, but I remove -filter='+ /rsync-filter',
nothing is deleted either, not even /rsync-filter.
If I remove /rsync-filter manually, and restart the same last command,
then /r3* and /r4* are removed.

I don't understand why?

Thanks,

Christophe.

Matt McCutchen wrote:
> I squished the bug!  Attached is a patch.  The name stands for "Do Not
> Elide Merge Files on a Local Receiver with --delete-excluded".
> 
> Matt
> 
> 
> ------------------------------------------------------------------------
> 
> ### Eclipse Workspace Patch 1.0
> #P rsync
> Index: exclude.c
> ===================================================================
> RCS file: /cvsroot/rsync/exclude.c,v
> retrieving revision 1.135
> diff -u -r1.135 exclude.c
> --- exclude.c	12 Aug 2006 16:22:03 -0000	1.135
> +++ exclude.c	31 Aug 2006 00:07:14 -0000
> @@ -1102,7 +1102,8 @@
>  			elide = am_sender ? 1 : -1;
>  		if (ent->match_flags & MATCHFLG_RECEIVER_SIDE)
>  			elide = elide ? 0 : am_sender ? -1 : 1;
> -		else if (delete_excluded && !elide)
> +		else if (!(ent->match_flags & MATCHFLG_MERGE_FILE)
> +				&& delete_excluded && !elide)
>  			elide = am_sender ? 1 : -1;
>  		if (elide < 0) {
>  			if (prev)



More information about the rsync mailing list