Yup, it is working.<br><br>
<div class="gmail_quote">On Mon, Jul 27, 2009 at 7:42 PM, Carlos Carvalho <span dir="ltr">&lt;<a href="mailto:carlos@fisica.ufpr.br">carlos@fisica.ufpr.br</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Matt McCutchen (<a href="mailto:matt@mattmccutchen.net">matt@mattmccutchen.net</a>) wrote on 26 July 2009 17:45:<br>

<div>
<div></div>
<div class="h5"> &gt;On Sun, 2009-07-26 at 21:37 +0530, Jignesh Shah wrote:<br> &gt;&gt; I have a situation where I want to delete some of my excluded patterns<br> &gt;&gt; but still want to preserve some other. For example consider below<br>
 &gt;&gt; source and destination directory hierarchy.<br> &gt;&gt;<br> &gt;&gt;   Source                    Dest<br> &gt;&gt;   ----------                   ---------<br> &gt;&gt; /foo/bar/                  /foo/bar/<br> &gt;&gt;     | -&gt; baz                  | -&gt; baz<br>
 &gt;&gt;     | -&gt; xyz                  | -&gt; xyz<br> &gt;&gt;     | -&gt; abc                  | -&gt; abc<br> &gt;&gt;                                  | -&gt; old-baz<br> &gt;&gt;<br> &gt;&gt; I am below comand using --delete-excluded  and as a result rsync<br>
 &gt;&gt; deletes exluded directories &quot;baz&quot; and &quot;abc&quot; and also deletes<br> &gt;&gt; &quot;old-baz&quot;. I want to preserve the &quot;old-baz&quot; and &quot;baz&quot; directories on<br> &gt;&gt; destination side and want &quot;abc&quot; to gets deleted. Could you tell me how<br>
 &gt;&gt; to tell rsync to do this?<br> &gt;&gt;<br> &gt;&gt; rsync -avz /foo/bar/ --delete-excluded --exclude=/baz --exclude=/abc<br> &gt;&gt; desthost:/foo/bar/<br> &gt;<br> &gt;Recall that an exclude filter is shorthand for a hide plus a protect if<br>
 &gt;--delete-excluded is off, or just a hide if it is on..  Since you want<br> &gt;some of your filters to protect destination files from deletion but not<br> &gt;others, your best bet would be to drop the --delete-excluded and specify<br>
 &gt;individual hide, protect, and plain exclude (hide+protect) filters.  For<br> &gt;more detail, carefully read the &quot;FILTER RULES&quot; section of the man page.<br> &gt;<br> &gt;Something like the following should do what you described:<br>
 &gt;<br> &gt;rsync -avz /foo/bar/ --exclude=/baz --filter=&#39;H /abc&#39; \<br> &gt;      --filter=&#39;P /old-baz&#39; desthost:/foo/bar/<br><br></div></div>Would just --filter=&#39;P /abc&#39; (without the --filter=&#39;H...&#39;) also work?<br>
<font color="#888888">--<br>Please use reply-all for most replies to avoid omitting the mailing list.<br>To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br></font></blockquote></div><br>