include directory, exclude contents
jw schultz
jw at pegasys.ws
Wed Dec 3 13:33:36 EST 2003
On Tue, Dec 02, 2003 at 12:57:00PM -0800, tim wrote:
> Forgot to mention this:
>
> server: rsync version 2.5.4 protocol version 26
> clients: rsync version 2.4.6 protocol version 24
Almost nobody can comment on the behavior of rsync versions
from the previous millenium. There have been too many bug
fixes and enhancements.
> Also I found this at http://rsync.samba.org/fom-serve/cache/93.html:
>
> How do I use rsync to replicate a directory structure without
> copying any files?
>
> rsync -av --include '*/' --exclude '*' source-dir dest-dir
>
> How would you apply this include/exclude pair for a specific directory?
> FOr example, every time a directory named 'tmp' shows up no matter where
> it is in the tree?
- tmp/*
It is not necessary to explicity include it unless to
prevent another pattern later from excluding it.
>
> Thanks,
> Tim.
>
> tim wrote:
> >I'm using a simple client/server backup pull model
> >
> >rsync -a --delete -e ssh --exclude-from=$exclude path/$client.exclude \
> > ${client}-rsync:/ $path/$client
> >
> >but can't seem to find the right 'exclude' combination to fetch certain
> >directories but not their contents. Unfortunately this was found during
> >a recent major restore where the excluded directories had to be manually
> >recreated.
> >
> >After more than 30 dry runs using variations in leading/trailing slash
> >plus wild cards, such as:
> >
> >+ .ccache/
> >- .ccache/**
> >
> >or:
> >
> >+ /cdrom/
> >- /cdrom/*
> >
> >I get either no directory or (directory + contents), but not (directory
> >- contents). I have looked back from current till Oct. 02 but can not
> >find an example of anyone wanting to do this.
> >
> >Debug didn't make much sense as the exclude scan seems not to recognize
> >an include (unless this is just syntax):
> >
> >add_exclude(/.ccache/,exclude)
> >add_exclude(+ .ccache/**,exclude)
> >
> >Thanks,
> >Tim.
> >
>
>
> --
> To unsubscribe or change options:
> http://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
>
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw at pegasys.ws
Remember Cernan and Schmitt
More information about the rsync
mailing list