Hey all, I'm having issues with the updateclient.local.exclude file.
Following the infrastructures.org mindset, I have a /local and a /remote
on every machine that are supposed to be out ef the systemimager
control. /local is filled with machine specific stuff (like huge
databases) that I really don't want in my image. So I added /local/* to
my updateclient.local.exclude file, so that the local directory is made
but the contents aren't touched.
However, this rule is causing updateclient to ignore all of /usr/local.
This is a big problem.
From the rsync man page:
Note that, when using the --recursive (-r) option
(which is implied by -a), every subcomponent of every
path is visited from the top down, so include/exclude
patterns get applied recursively to each subcomponent.
The exclude patterns actually short-circuit the direc-
tory traversal stage when rsync finds the files to
send. If a pattern excludes a particular parent direc-
tory, it can render a deeper include pattern ineffec-
tual because rsync did not descend through that
excluded section of the hierarchy.
What this means for me is that the exlude directive of /local/ is
matching the /local/ part of /usr/local/ and excluding all of it.
It even gives a solution to this problem in the man page:
The +/- rules are most useful in a list that was read
from a file, allowing you to have a single exclude list
that contains both include and exclude options in the
proper order.
Remember that the matching occurs at every step in the
traversal of the directory hierarchy, so you must be
sure that all the parent directories of the files you
want to include are not excluded. This is particularly
important when using a trailing �*� rule. For
instance, this won�t work:
+ /some/path/this-file-will-not-be-found
+ /file-is-included
- *
This fails because the parent directory "some" is
excluded by the �*� rule, so rsync never visits any of
the files in the "some" or "some/path" directories.
One solution is to ask for all directories in the hier-
archy to be included by using a single rule:
--include=�*/� (put it somewhere before the
--exclude=�*� rule). Another solution is to add spe-
cific include rules for all the parent dirs that need
to be visited. For instance, this set of rules works
fine:
+ /some/
+ /some/path/
+ /some/path/this-file-is-found
+ /file-also-included
- *
Anyway, I tried this solution, and it failed. It turns out that
updaclient does not include updateclient.local.exclude using the rsync
flag --exclude-from, but instead parses the file itself and adds
individual --exclude rules. However, when it parses the file, it
discards any lines that begin with '+', completely invalidating the
solution proposed in the rsync page.
So I have two questions:
* Why does updateclient not use the --exclude-file option?
* Why does it discard lines beginning with a '+'?
Independant of those questions, how can I exclude /local and still get
/usr/local?
Thanks,
-ben
--
Ben Hartshorne
email: [EMAIL PROTECTED]
http://ben.hartshorne.net
pgpoPllIQjvH1.pgp
Description: PGP signature
