This is a discussion on Re: Use of --include and --exclude when source paths are not known within the Rsync forums, part of the Networking and Network Related category; To answer my own question - the answer was to run a find first, saving the output as a file, then ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
To answer my own question - the answer was to run a find first, saving the
output as a file, then use the --files-from option to rsync. Two further issues though... a minor one is that using --files-from seems to prevent any possibility of deleting orphans at the remote end. More importantly, windows permissions inheritance gets hosed by rsync, every time. Use of 'nontsec' doesn't help. Can anyone help before I abandon rsync? Thanks Mike. "Mike Ray-Jones" <mike@ray-jones.org.uk> wrote in message news:406b33db$0$65064$65c69314@mercury.nildram.net ... > I want to use rsync to synchronise just selected directories. The source > structure looks like this: > > 0/ > 0/xxx1/foo > 0/xxx1/bar > 0/xxx1/external/ > 0/xxx1/external/foo > 0/xxx1/external/bar > 0/xxx2/foo > 0/xxx2/bar > 0/xxx2/external/ > 0/xxx2/external/foo > 0/xxx2/external/bar > ... > There are 000's of folders 'xxxx' containing 000's of files (foo, bar etc) > that I don't want to sync; the destination should be just the 'external' > directory and its contents, thus: > > 0/xxx1/external/ > 0/xxx1/external/foo > 0/xxx1/external/bar > 0/xxx2/external/ > 0/xxx2/external/foo > 0/xxx2/external/bar > ... > I tried the following cmd line: > > rsync -avR --delete --include "external/" --exclude "*" "0" remote::test > > ... but the --exclude "*" is excluding the whole of "0/". I can't explicitly > name the parents of all the "external" folders - there are 000's are they > are always changing. What am I missing here? Do I need a script? > > Any help would be gratefully received. > > Mike. > > |
![]() |
| Thread Tools | |
| Display Modes | |
|
|