cdist/cdist/conf/type/__clean_path/man.rst

69 lines
1.6 KiB
ReStructuredText
Raw Normal View History

2019-03-30 11:21:13 +00:00
cdist-type__clean_path(7)
=========================
NAME
----
cdist-type__clean_path - Remove files and directories which match the pattern.
DESCRIPTION
-----------
Remove files and directories which match the pattern.
2020-06-10 08:38:14 +00:00
Provided path must be a directory.
2019-03-30 11:21:13 +00:00
Patterns are passed to ``find``'s ``-regex`` - see ``find(1)`` for more details.
Look up of files and directories is non-recursive (``-maxdepth 1``).
Parent directory is excluded (``-mindepth 1``).
This type is not POSIX compatible (sorry, Solaris users).
REQUIRED PARAMETERS
-------------------
pattern
Pattern of files which are removed from path.
OPTIONAL PARAMETERS
-------------------
2020-06-10 08:38:14 +00:00
path
Path which will be cleaned. Defaults to ``$__object_id``.
2019-03-30 11:21:13 +00:00
exclude
Pattern of files which are excluded from removal.
onchange
The code to run if files or directories were removed.
EXAMPLES
--------
.. code-block:: sh
__clean_path /etc/apache2/conf-enabled \
--pattern '.+' \
--exclude '.+\(charset\.conf\|security\.conf\)' \
--onchange 'service apache2 restart'
2020-06-10 08:38:14 +00:00
__clean_path apache2-conf-enabled \
--path /etc/apache2/conf-enabled \
--pattern '.+' \
--exclude '.+\(charset\.conf\|security\.conf\)' \
--onchange 'service apache2 restart'
2019-03-30 11:21:13 +00:00
AUTHORS
-------
Ander Punnar <ander-at-kvlt-dot-ee>
COPYING
-------
Copyright \(C) 2019 Ander Punnar. You can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.