Re: rsync - exclude dirs from source but keep all files on target



Henri =?ISO-8859-1?Q?Schom=E4cker?= <henri.schomaecker@xxxxxxxxxxxxxxxx> writes:

Henri wrote:
The --exclude-from Option implies the --delete option, which will also
delete directories and files from the target-server which do not exist on
the source-server any more. - But this is in this case NOT what I want!

I also want to KEEP directories and files which are not existant on the
source-server any more and don't get it working.

Unruh wrote:
Why not just use the --exclude="/home/excluded/dir/"
option, and have one for each excluded directory. Unless yo uhave 100 of
them, this is probably just as easy.


As I already wrote, I tried it, now also with multiple single --exclude=...
options, but if I do not add a --delete option, the excluded dirs get
transferred also. I can't believe that that's supposed to act that way, but
it does on my gentoo machine and also on a Terastation Pro II.

"I also tried it"-- what "it"? As you know computers are tremendously
finiky. It will depend on exactly what the "it" was.

The --exclude works fine for me.
But use the **
Ie,
--exclude **/nameofdirectory/
The ** matches arbitrary stuff including /s. Ie, if your paths are
excluded/dir and you put in --exclude=/home/excluded/dir it will NOT work.

Note that I do this all the time and it does work.


Many thanks for your already written replies, but maybe you have some more
hints?

Many thanks in advance,
yours Henri

.



Relevant Pages