Beating a dead horse
Harry Putnam
reader at newsguy.com
Tue Mar 18 20:31:53 MDT 2014
Sorry to do this .... AGAIN
Every year or two I get stuck on this same problem involving
excluding.
Seems I learn how its done then 2yrs later I've totally forgotten and
when I look up my notes ... this new need is just different enough
that they don't apply.
Here's the problem. (Simplified... and I've skipped some of the
repetitive output)
On remote
ls A/
a/ b/ c/ d e
on local
pwd
/rmh/dir
from local
rsync -avvz --exclude-from=file user at remote:/A/ /rmh/dir/
cat 'file':
*
+ a
+ b
That results in: Sender hiding a/ because of pattern *
" ... ditto ... " b/ because of pattern *
" ... ditto ... " c/ because of pattern *
" ... ditto ... " d because of pattern *
" ... ditto ... " e because of pattern *
[...]
cat file:
*
+ a/*
+ b/*
Same result
cat file:
*
+ a/**
+ b/**
Same result
Then put the directories ahead of the asterisk
+ a/
+ b/
*
Nearly the same with this difference:
showing directory a/ (but its still blocked along with
everything below)
showing directory b/ (but its still blocked along with
everything below)
The rest of the output the same as before hiding etc etc
But the list is a little longer since it now includes the files
directly under a and b
Ok, I start adding asterisks a/*
a/**
a/**/
All get the result similar to the first examples... everything hidden
OK, so how can I transfer only a and b.
I mean besides changing my command to read something like:
rsync -avv user at remote:/A/a user at remote:/A/b /rmh/dir
Which would work, but since the directories involved are many layers
deep it turns into a ridiculous exercise... especially since I know
there is some syntax that will do this.
More information about the rsync
mailing list