How to change permissions on a directory without meaning to... - include/exclude semantics

jw schultz jw at pegasys.ws
Wed Oct 8 02:55:45 EST 2003


On Tue, Oct 07, 2003 at 11:25:36AM +0100, Tim Small wrote:
> jw schultz wrote:
> > Your attempt to exclude the root directory, if successful,
> > would have prevented the whole transfer on the parent
> > directory path walking principle.  So that is not the way to
> > go.
> > 
> >
> Yes - I assumed that this was probably some side-effect of
> the current implementation - and it's not really so much of
> a problem, as long as it is documented behaviour, because it
> doesn't seem to me to be intuitive behaviour to joe
> bloggs...  I'd just re-read the include/exclude portion of
> the manual page before I started this operation yesterday,
> to make sure I was clear on it :-/.

Given the presence of

	If you end an exclude list with --exclude '*', note
	that since the algorithm is applied recursively that
	unless you explicitly include parent directories of
	files you want to include then the algorithm will
	stop at the parent directories and never see the
	files below them.  To include all directories, use
	--include '*/' before the --exclude '*'.

and other mentions of recursion in the EXCLUDE PATTERNS
section I'm not sure how you get the idea of this being an
exclude issue.

My incapacity to understand how users miss the implications
of parent directory pattern matching in tree traversal (what
a mouthful) aside, it is clear that that particular issue
does need addressing by someone better at creating human
readable text than code.

> >Using a source of "/." should give the same behavior as you
> >are experiencing and "/./" the behavior you want.  Wayne may
> >have some comments on this.

For the sake of completeness i want to thank everyone who
didn't make the bad suggestion of "/*".  In addition to
issues with local shell interaction in pulls "/*" is not
equivalent to "/./" because it does not include top level
dot files. On non-Linux systems root's home directory is
often / so there are important dot files in /.

> I've included a documentation patch, after having read Wayne's posting,
> but you guys might want to tweak it a bit, or alter it's location, but
> hopefully it'll save someone like me a red face ;o).

Thanks for the documentation attempt.

I do concur that some note of "/" as source including the
root directory node.  This should probably be attached to
this paragraph early in the USAGE section:

	a trailing slash on the source changes this
	behaviour to transfer all files from the directory
	src/bar on the machine foo into the /data/tmp/.  A
	trailing / on a source name means "copy the contents
	of this directory".  Without a trailing slash it
	means "copy the directory". This difference becomes
	particularly important when using the --delete
	option.

But i draw a blank on what it should say.



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

		Remember Cernan and Schmitt



More information about the rsync mailing list