Table of Contents


filescan - starts and monitors a collection of processes managing files


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


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.


-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)


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

$ filescan -d var/perfspool /usr/bin/perl

Automatically compress all files moved into a directory:

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


filescan should be run under supervise(8) control of the daemontools ( because of security reasons like dropping rights and reliability by using supervise.


Frank Bergmann,

Table of Contents