[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rsync
Subject:    Re: rsync walks through excluded directories...
From:       Wayne Davison <wayned () samba ! org>
Date:       2011-03-15 16:20:23
Message-ID: AANLkTikSaTCqkPbVSrqpxiUwMzSxMBn+2EXU-=BTdhj- () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Tue, Mar 15, 2011 at 7:41 AM, Jean-Christophe Guillain <
jc.guillain@gmail.com> wrote:

> $ rsync -aH --del --ignore-errors --filter="- /lost+found/*" --filter="-
> /.snapshot/*" /data/orig_disks/vol-opt/ /data/bckp_disks/vol-opt/
>

Note that it is more efficient to leave off the trailing '*' so that the
directory is excluded rather than the contents of the directory.  With the
'*', rsync has to list the dir's contents and see if it matches the exclude
or not.  However, that has the side effect of not creating (empty)
lost+found and .snapshot dirs on the destination if they don't already
exist.

rsync     1599        root    3r      DIR               0,25    12288
> 12117707 /data/orig_disks/vol-opt/opt/.snapshot/some/directory/somefile
>

That .snaptshot doesn't match your excludes since it's down inside the opt
subdir, not at the root of the transfer.  If you want to exclude .snapshot
dirs anywhere in the tree, leave off the leading slash.  If you want to
exclude that dir in particular, add the missing /opt prefix.

..wayne..

[Attachment #5 (text/html)]

<div class="gmail_quote">On Tue, Mar 15, 2011 at 7:41 AM, Jean-Christophe Guillain \
<span dir="ltr">&lt;<a \
href="mailto:jc.guillain@gmail.com">jc.guillain@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;"> $ rsync -aH --del --ignore-errors --filter=&quot;- \
/lost+found/*&quot; --filter=&quot;- /.snapshot/*&quot; /data/orig_disks/vol-opt/ \
/data/bckp_disks/vol-opt/<br></blockquote><div><br></div><div>Note that it is more \
efficient to leave off the trailing &#39;*&#39; so that the directory is excluded \
rather than the contents of the directory.   With the &#39;*&#39;, rsync has to list \
the dir&#39;s contents and see if it matches the exclude or not.   However, that has \
the side effect of not creating (empty) lost+found and .snapshot dirs on the \
destination if they don&#39;t already exist.</div> <div><br></div><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;">rsync         1599               root       3r           DIR \
0,25       12288     12117707 \
/data/orig_disks/vol-opt/opt/.snapshot/some/directory/somefile<br> \
</blockquote><div><br></div><div>That .snaptshot doesn&#39;t match your excludes \
since it&#39;s down inside the opt subdir, not at the root of the transfer.   If you \
want to exclude .snapshot dirs anywhere in the tree, leave off the leading slash.   \
If you want to exclude that dir in particular, add the missing /opt prefix.</div> \
<div><br></div></div>..wayne..<br>



-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic