Kfir Cohen
2005-Dec-28 13:14 UTC
double / on --exclude flag cuse the path not to be excluded
Hi, i found out that if you are using the following command: rsync -aHvS --exclude /root//Desktop/ /root /tmp/kuku the Desktop Dir will not be excluded. but if i use: rsync -aHvS --exclude /root/Desktop/ /root /tmp/kuku1 the Desktop Dir will be excluded. the rsync version that i find it is: rsync version 2.6.6 protocol version 29 -KC -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Wayne Davison
2005-Dec-28 17:47 UTC
double / on --exclude flag cuse the path not to be excluded
On Wed, Dec 28, 2005 at 03:09:14PM +0200, Kfir Cohen wrote:> rsync -aHvS --exclude /root//Desktop/ /root /tmp/kuku > > the Desktop Dir will not be excluded.That''s correct -- rsync will never construct a pathname that contains a double slash, so the path will never match a pattern that contains a double slash. ..wayne..
Kfir Cohen
2005-Dec-28 19:53 UTC
double / on --exclude flag cuse the path not to be excluded
thank you for your quick response. How can i ad this to your bugzilla project? --KC ________________________________ ???: Wayne Davison [mailto:wayned@samba.org] ????: ? 28/12/2005 12:46 ??: Kfir Cohen ???? ??????: rsync@lists.samba.org ????: Re: double / on --exclude flag cuse the path not to be excluded On Wed, Dec 28, 2005 at 03:09:14PM +0200, Kfir Cohen wrote:> rsync -aHvS --exclude /root//Desktop/ /root /tmp/kuku > > the Desktop Dir will not be excluded.That''s correct -- rsync will never construct a pathname that contains a double slash, so the path will never match a pattern that contains a double slash. ..wayne..
Matt McCutchen
2005-Dec-28 21:15 UTC
double / on --exclude flag cuse the path not to be excluded
On Wed, 2005-12-28 at 14:52 -0500, Kfir Cohen wrote:> thank you for your quick response. > How can i ad this to your bugzilla project? > --KC > > rsync -aHvS --exclude /root//Desktop/ /root /tmp/kuku > > the Desktop Dir will not be excluded.Rsync is behaving correctly by not excluding /root/Desktop since this folder does not match the double slashes in the exclude pattern. This is not a bug. If, in writing a script, you need double-slash exclude paths to match (single-slash) files, run the exclude paths through sed -re ''s./+./.g'' or similar before passing them to rsync. -- Matt McCutchen, ``hashproduct'''' hashproduct@verizon.net -- http://hashproduct.metaesthetics.net/
Kfir Cohen
2005-Dec-29 05:31 UTC
double / on --exclude flag cuse the path not to be excluded
Matt McCutchen wrote:> On Wed, 2005-12-28 at 14:52 -0500, Kfir Cohen wrote: >> thank you for your quick response. >> How can i ad this to your bugzilla project? >> --KC >>> rsync -aHvS --exclude /root//Desktop/ /root /tmp/kuku >>> the Desktop Dir will not be excluded. > > Rsync is behaving correctly by not excluding /root/Desktop since this > folder does not match the double slashes in the exclude pattern. This > is not a bug. If, in writing a script, you need double-slash exclude > paths to match (single-slash) files, run the exclude paths through sed > -re ''s./+./.g'' or similar before passing them to rsync.Almost all application and binaries on linux discount the double slashes. try to change dir with double slash or even tar cp , they all dont car how much slash you have. if there are two slashes and there no dir between them they remove on of the slash. -KC
Paul Slootman
2005-Dec-29 08:45 UTC
double / on --exclude flag cuse the path not to be excluded
On Thu 29 Dec 2005, Kfir Cohen wrote:> Almost all application and binaries on linux discount the double slashes. > try to change dir with double slash or even tar cp , they all dont car > how much slash you have. if there are two slashes and there no dir > between them they remove on of the slash.This is a bogus argument. "rsync /path//to/file wherever:" will work just fine, ignoring the double slash. That is similar to what you''re giving as examples. However, the exclude is special, as it matches against a certain text. Compare it to this: $ find /etc -wholename /etc//passwd -print $ That won''t find anything either, simply because "find" will never find a path with a double slash in it. Just fix your script.... Paul Slootman