| www.delorie.com/gnu/docs/cfengine/cfengine-Tutorial_37.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
File sweeps are searches through a directory tree in which many files are examined and considered for processing in some way. There are many instances where one uses cfagent to perform a file sweep.
files action, for checking access rights and ownership
of files.
tidy action, for checking files for deletion.
copy action, while recursively checking whether to
copy a file tree.
editfiles action, while recursively checking whether to
edit the files in a tree of files.
ignore.
tidy does not allow ignore,include and exclude. It is documented
in the section on tidying, (see Reference manual).
Items declared under the global ignore section affect files,
copy, links and tidy. For file sweeps within files, copy and links, you
may provide private ignore lists using ignore=. The difference between
exclude and ignore is that ignore can deal with absolute directories. It prunes
directories, while exclude only looks at the files within directories.
For file sweeps within files and copy you can specify
specific search parameters using the keywords include=
and exclude= and as of version 1.6.x filter=.
For example,
files: /usr/local/bin m=0755 exclude=*.ps action=fixall |
Specifying the include= keyword is slightly different since it
automatically restricts the search to only named patterns (using *
and ? wildcards), whenever
you have one or more instances of it. If you include patterns in this
way, cfagent ignores any files which do not match the given patterns.
It also ignores any patterns which you have specified in the global
ignore-list as well as patterns excluded with exclude=pattern.
In other words, exclusions always override inclusions.
If you exclude a pattern or a directory and wish to treat it in some special way, you need to code an explicit check for that pattern as a separate entity. For example, to handle the exluded `.ps' files above, you would need to code something like this:
files: /usr/local/bin m=0644 include=*.ps action=fixall |
Note: don't be tempted to enclose your wildcards in quotes. The quotes will be treated literally and the pattern might not match the way you would expect.
For editfiles the syntax is somewhat different. Here one needs to add
lines to the edit stanza:
editfiles:
{ /tmp/testdir
Include .*
Exclude bla.*
Ignore "."
Ignore ".."
Recurse 6
ReplaceAll "search" With "replace"
}
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |