Re: Yet another include/exclude question

2009-11-09 Thread Wayne Davison
On Sun, Nov 8, 2009 at 10:21 PM, Thomas Gutzler thomas.gutz...@gmail.comwrote:

 I thought --include=/this_dir/ --include=/this_dir/*** would do it,
 but it doesn't. The exclude * seems to overwrite the include matches:
  [sender] hiding file this_dir/foo because of pattern *


Order is important.  Whatever matches first, is what takes effect.  Also,
*** matches both the dir and its contents, so you could use:

  --include='/this_dir/***' --exclude=*

As long as this_dir is in the root of the transfer, that will work.

..wayne..
-- 
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

Re: Yet another include/exclude question

2009-11-09 Thread Thomas Gutzler
Thanks everyone for your help, I've got what I want.

Wayne Davison wrote:
 On Sun, Nov 8, 2009 at 10:21 PM, Thomas Gutzler
 thomas.gutz...@gmail.com mailto:thomas.gutz...@gmail.com wrote:
 
 I thought --include=/this_dir/ --include=/this_dir/*** would do it,
 but it doesn't. The exclude * seems to overwrite the include matches:
  [sender] hiding file this_dir/foo because of pattern *
 
 
 Order is important.  Whatever matches first, is what takes effect. 
 Also, *** matches both the dir and its contents, so you could use:
 
   --include='/this_dir/***' --exclude=*

It seems to be very picky about the order. Thanks for pointing that out.
My first attempt has been
--include=*/ --include=*.foo --include=*.bar
--include=/this_dir/*** --exclude=*
which did nothing than *.foo and *.bar. Shuffling it around, I found that
--include=*/ --include=/this_dir/*** --include=*.foo
--include=*.bar --exclude=*
does what I want and it even makes sense.

Cheers,
  Tom

-- 
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


Re: Yet another include/exclude question

2009-11-09 Thread Matt McCutchen
On Tue, 2009-11-10 at 09:45 +0800, Thomas Gutzler wrote:
 Thanks everyone for your help, I've got what I want.
 
 Wayne Davison wrote:
  On Sun, Nov 8, 2009 at 10:21 PM, Thomas Gutzler
  thomas.gutz...@gmail.com mailto:thomas.gutz...@gmail.com wrote:
  
  I thought --include=/this_dir/ --include=/this_dir/*** would do it,
  but it doesn't. The exclude * seems to overwrite the include matches:
   [sender] hiding file this_dir/foo because of pattern *
  
  
  Order is important.  Whatever matches first, is what takes effect. 
  Also, *** matches both the dir and its contents, so you could use:
  
--include='/this_dir/***' --exclude=*
 
 It seems to be very picky about the order. Thanks for pointing that out.
 My first attempt has been
 --include=*/ --include=*.foo --include=*.bar
 --include=/this_dir/*** --exclude=*
 which did nothing than *.foo and *.bar. Shuffling it around, I found that
 --include=*/ --include=/this_dir/*** --include=*.foo
 --include=*.bar --exclude=*
 does what I want and it even makes sense.

Those two commands should be equivalent.  If you have a reproducible
case in which they aren't, please share it and we can see if there's a
bug.

I tried the first command and it worked fine for me.  That is, after I
fixed a typo I made in the name of this_dir, which left the
--include=/this_dir/*** nonfunctional and gave a result like the one
you cited above:

[sender] hiding file this-dir/one because of pattern *

-- 
Matt

-- 
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


Re: Yet another include/exclude question

2009-11-09 Thread Thomas Gutzler
Matt McCutchen wrote:
 On Tue, 2009-11-10 at 09:45 +0800, Thomas Gutzler wrote:
 Thanks everyone for your help, I've got what I want.

 My first attempt has been
 --include=*/ --include=*.foo --include=*.bar
 --include=/this_dir/*** --exclude=*
 which did nothing than *.foo and *.bar. Shuffling it around, I found that
 --include=*/ --include=/this_dir/*** --include=*.foo
 --include=*.bar --exclude=*
 does what I want and it even makes sense.
 
 Those two commands should be equivalent.  If you have a reproducible
 case in which they aren't, please share it and we can see if there's a
 bug.

Going through my history, I found that I must have accidentally put a
whitespace between '--include' and '=' which wasn't very obvious at the
time thanks to the line wrapping of my terminal. I should have used an
include file instead :)
So no, no bugs.

Tom

-- 
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


Re: Yet another include/exclude question

2009-11-08 Thread Thomas Gutzler
What if I also want to include everything in /this_dir/ without running
two instances and still being able to use --delete?
I thought --include=/this_dir/ --include=/this_dir/*** would do it,
but it doesn't. The exclude * seems to overwrite the include matches:
 [sender] hiding file this_dir/foo because of pattern *

Tom

Steven Monai wrote:
 Tony wrote:
 On Nov 6, 2009, at 12:43 AM, Thomas Gutzler wrote:
 Hi,

 How can I include only *.foo and *.bar files in an rsync?
 To make it a bit more difficult: Those files can be anywhere in the
 directory structure.

 I've been reading and trying for a while but the best I got is all
 *.foo and *.bar files in ./ but none of the ones inside any
 directories.
 There is an example in the man pages for *.c files that will do what you
 want.

 Try:  --include=*/ --include=*.foo --exclude=*
 
 Yes. I would also strongly recommend the section of the man page that
 describes --prune-empty-dirs.
 
 Cheers,
 -SM
 --

-- 
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


Yet another include/exclude question

2009-11-05 Thread Thomas Gutzler
Hi,

How can I include only *.foo and *.bar files in an rsync?
To make it a bit more difficult: Those files can be anywhere in the
directory structure.

I've been reading and trying for a while but the best I got is all
*.foo and *.bar files in ./ but none of the ones inside any
directories.

Cheers,
  Tom
-- 
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


Re: Include / Exclude question

2001-09-27 Thread Dave Dykstra

On Wed, Sep 26, 2001 at 09:17:03AM +0300, Coroiu Cosmin Marius wrote:
 Dave Dykstra wrote:
  
  On Tue, Sep 25, 2001 at 12:18:31PM +0300, Coroiu Cosmin Marius wrote:
 Hello all !
 I want to save some of the directories and files from my home dir.For
   that I create a new directory where I moved the file for sync and I made
   some symlinks to the dirs which I want to include in sync.The hidden
   directoris (like .netscape) are not included in sync. How can I say to
   rsync to include these directories too and how can I exclude a list of
   directories (I have .mozilla too and I don't want do synchronize the
   cache dir from .netscape and .mozilla ) ?
  
  Have you checked the man page for --include and --exclude?
  
  If you want rsync to copy files that are on the other end of a symlink,
  you'll need to use -L.
  
  - Dave Dykstra
   
   Hello Dave ,
 
   I used already the -L option and it works but only for symlinks with
 other name than .name ..All this symlinks (.netscape , .mozilla ) are
 not included in synchronization.If I rename them it works ...That it's
 my question : how can include hidden dirs and symlinks ?


Normally rsync will not skip . files.  Send me your complete rsync
command line and the ls -l listings of your symlinks.  If your whole reason
for the symlinks is to control what to include and exclude, chances are 
you can skip the symlinks completely and just use --exclude.

- Dave Dykstra




Include / Exclude question

2001-09-25 Thread Coroiu Cosmin Marius

Hello all !
I want to save some of the directories and files from my home dir.For
that I create a new directory where I moved the file for sync and I made
some symlinks to the dirs which I want to include in sync.The hidden
directoris (like .netscape) are not included in sync. How can I say to
rsync to include these directories too and how can I exclude a list of
directories (I have .mozilla too and I don't want do synchronize the
cache dir from .netscape and .mozilla ) ?

Thanks in advance

Crosby.

-- 
Whatever you do will be insignificant, but it is very important 
that you do it.  --Mahatma Gandhi

ICQ #35594993   Linux Registered User #216853




Re: Include / Exclude question

2001-09-25 Thread Dave Dykstra

On Tue, Sep 25, 2001 at 12:18:31PM +0300, Coroiu Cosmin Marius wrote:
   Hello all !
   I want to save some of the directories and files from my home dir.For
 that I create a new directory where I moved the file for sync and I made
 some symlinks to the dirs which I want to include in sync.The hidden
 directoris (like .netscape) are not included in sync. How can I say to
 rsync to include these directories too and how can I exclude a list of
 directories (I have .mozilla too and I don't want do synchronize the
 cache dir from .netscape and .mozilla ) ?

Have you checked the man page for --include and --exclude?

If you want rsync to copy files that are on the other end of a symlink,
you'll need to use -L.

- Dave Dykstra




Re: Include / Exclude question

2001-09-25 Thread Coroiu Cosmin Marius

Dave Dykstra wrote:
 
 On Tue, Sep 25, 2001 at 12:18:31PM +0300, Coroiu Cosmin Marius wrote:
Hello all !
I want to save some of the directories and files from my home dir.For
  that I create a new directory where I moved the file for sync and I made
  some symlinks to the dirs which I want to include in sync.The hidden
  directoris (like .netscape) are not included in sync. How can I say to
  rsync to include these directories too and how can I exclude a list of
  directories (I have .mozilla too and I don't want do synchronize the
  cache dir from .netscape and .mozilla ) ?
 
 Have you checked the man page for --include and --exclude?
 
 If you want rsync to copy files that are on the other end of a symlink,
 you'll need to use -L.
 
 - Dave Dykstra

Hello Dave ,

I used already the -L option and it works but only for symlinks with
other name than .name ..All this symlinks (.netscape , .mozilla ) are
not included in synchronization.If I rename them it works ...That it's
my question : how can include hidden dirs and symlinks ?

Crosby. 
-- 
Whatever you do will be insignificant, but it is very important 
that you do it.  --Mahatma Gandhi

ICQ #35594993   Linux Registered User #216853