DO NOT REPLY [Bug 7456] exclude directory based on presence of a file

samba-bugs at samba-bugs at
Wed Mar 2 14:09:02 MST 2011

------- Comment #4 from brian at  2011-03-02 15:09 CST -------
Ok you can say you don't feel like doing it, or including it if someone else
makes a patch, but you can't say the existing features actually provide the
requested semantic unless there is some exotic regex that could be used with
one of the existing filter options, nor can you say "you don't really need

The form submission chopped off a lot of my original note which went into my
actual use case and why other software has included exactly this semantic for
years but I decided to leave it since it happened to include the feature
request and my addition to it. I didn't think this feature really required
explicit examples to prove that it fills a hole in the current ability to
express inclusions/exclusions and I didn't think you would presume to know
somehow that we don't actually need or want what we asked for for a
non-spurious reason.

People need it often enough to request it and for it to appear in at least star
and rdiff-backup and surely others. In various situations this is just the most
efficient, automatic, reliable, self-documenting, self-propogating,
self-administrable semantic to express the really desired behavior. We make do
without only because we must.

True, I can and do currently provide essentially this desired behavior myself
by dint of scripting around rsync. But This is true for much of rsync's current
functionality so that's not much of an argument by itself.

And since I do in fact provide this behavior by scripting, it IS a low priority
wish for me. I'm not suggesting otherwise.

But it's not a spurious request either just to cause you (or someone) work for
no reason. It's not out of place, in that it's not asking rsync to do something
other than help replicate files. It's also not breaking the tradition of
keeping unix tools low level instead of all-singing-all-dancing, any more than
the extensive list of features already in rsync does, or the -r flag to cp
(when find and xargs exist), or the exec flag to find (when xargs exists)

In my case the per-directory exclude file idea doesn't really work for me
because I it happens I can't place arbitrary files with arbitrary names and
arbitrary contents in the directories that I want to include or exclude. What I
CAN do is tell developers "from now on, if you want a given database file to be
excluded from the frequent daytime rsyncs, just create a blank screen named
'nosync' in that file". That's meaningless to you but it solves many problems
for me at once. 

To me it means:
* developers are not screwing up things by diddling with files manually at the
filesystem level
* the exclude marker file they created will be recognized by the various
special binaries that comprise the closed source commercial DB & 4GL we use
* if an excluded file is copied, the copy will also be excluded automatically
(not so any other way).

This would all be not only possible but simple if I could tell rsync "use the
.exclude feature, and look for files named screen.nosync instead of .exclude"

Just like,

I wouldn't have to worry about maintaining directory lists on all the growing
number of production boxes. That's a problem because the list of directories is
not the same on every box, and not the same from day to day, and it's not
really me or any one person who decides what should be excluded. And yet, I
could still do reasonably centralized management because I happen to have the
means to create a file on one box and clone it to the same place on all others,
or delete it. And the developers do most work on a single development server
which pushes out new code and db files out to all others.

And again, it's not just me. Star and rdiff-backup are just two examples I
happened to already know right off the top of my head without googling. It IS a
generically useful semantic whether you personally happen to have a use for it
or not. The per-dir-filter is cool but what would come closer to what's really
needed would be some exotic regex syntax that could be used in the existing
filter options. That would possibly be even more useful than the requested
feature since it would allow the user to express even more specialized rules.

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list