Table of Contents

Name

filescan - starts and monitors a collection of processes managing files

Synopsis

filescan [-d changdir] [-I includestring] [-X excludestring] path/to/command [arg(s)]

Description

filescan starts one path/to/command process for each file, dir or other dir entries of the current directory, up to a limit of 20 processes. It does this by executing path/to/command [arg(s)] FILE for each dir entry FILE. filescan skips directory entries starting with dots.

Every five seconds, filescan checks for dir entries again. If it sees a new entry, it starts a new path/to/command process. If it sees a dir entry where a process has exited, it restarts the process.

filescan is designed to run forever. If it has trouble on vfork() or running path/to/command it prints a message to stderr; it will try again five seconds later.

filescan does not need a configuration file or resource config. The usage of Dan Bernstein’s daemontools is strongly recommended.

Options

-d directory
change to directory

before reading dir entries

-I includestring
only process dir entries with

filenames containing includestring

-X excludestring
only process dir entries

with filenames not containing excludestring

See Also

svscan(8) , supervise(8)

http://cr.yp.to/daemontools.html

Examples

This example shows the substitution of NPCD in bulk mode of pnp4nagios:

$ filescan -d var/perfspool /usr/bin/perl process_perfdata.pl

Automatically compress all files moved into a directory:

$ filescan -d zipped -X .gz /usr/bin/gzip -9

Caveats

filescan should be run under supervise(8) control of the daemontools (http://cr.yp.to/daemontools.html) because of security reasons like dropping rights and reliability by using supervise.

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents