filelist calculation algoritm

jw schultz jw at pegasys.ws
Sun Jan 5 01:04:00 EST 2003


On Sat, Jan 04, 2003 at 04:02:23PM -0800, Wayne Davison wrote:
> On Sat, Jan 04, 2003 at 12:40:05PM -0800, jw schultz wrote:
> > One specifying subpaths and the other for those having a shared
> > prefix.
> 
> I don't see why this is needed.  For instance, your example of a shared
> prefix:
> 
> > 	find srcdir | myfilter | rsync --file-list - srcdir destloc
> 
> would be easily written without any sharing:
> 
>     find srcdir | myfilter | rsync --file-list - . destloc

that would produce destloc/srcdir/....
when you might want a copy of srcdir at destloc instead of
in destloc.

> 
> or:
> 
>     find /foo/bar | myfilter | rsync --file-list - / destloc

And that would produce destloc/foo/bar/...
What if you wanted destloc/bar/...  or destloc/...
That could be achieved with "rsync --file-list - /foo destloc"
or "rsync --file-list - /foo/bar destloc" respectively

> Am I missing something?

The scope of source also affects what constitutes a safe
symlink.

> 
> > doing
> > 	rsync --file-list-relative - src dest <<EOL"
> > 	file1
> > 	file2
> > 	dir1/file3
> > 	EOL
> > would actually sync
> > 	src/file1
> > 	src/file2
> > 	src/dir1
> > 	src/dir1/file3
> > to
> > 	dest/file1
> > 	dest/file2
> > 	dest/dir1
> > 	dest/dir1/file3
> 
> I think that should only happen if the --relative option is set.
> Otherwise all 3 files should go directly into "dest".

I don't think so.  --relative would create
	dest/src/file1
	dest/src/file2
	dest/src/dir1
	dest/src/dir1/file3
Would it not?

The point here is to tell rsync "sync these files from this
location to this other location"

Consider
	find /foo/bar | myfilter | while read f; do rsync $f destloc${f#/foo/bar}; done
and
	--include-from filelist --exclude '*' --exclude '*/'

These are what we currently tell people to do.  The first
has lots of overhead for the session setup and teardown and
fork/exec.  The second has you walking entire file trees
comparing patterns (apparently non-intuitive) when we only
care about a set list of files.

In any case the --file-list approach will meet peoples real
(and imagined) needs in a much more direct way.


At this time, i don't need this functionality myself.  But
this hits the list quite frequently and i thought it would
be good to discuss what it should look like before someone
cranks out a patch that is poorly thought out.



-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt



More information about the rsync mailing list