spoolprocess - process files in a spool directory



NAME

spoolprocess - process files in a spool directory


SYNOPSIS

spoolprocess [OPTIONS] -d DIRECTORY


DESCRIPTION

Take all files in DIRECTORY specified by -d option, group them by their basename, ie. name without an optional "dot + number" suffix (.1, .2, ..., also known as version number), and call /etc/spoolprocess/BASENAME > programm for each group to handle each files.

The handler programm (usually a script) gets the spool file's path as an argument.

If the programm succeeds, spoolprocess(1) deletes the files for which the handler script was successful, or all files in the group if --latest asked and it was successful.


OPTIONS

-d, --directory DIRECTORY

This option is repeatable.

-g, --group BASENAME

Process only those files with BASENAME. This option is repeatable.

-L, --latest

Process only the latest (highest version number) file in each group. The default is to process all files in ascending order of version numbers.

-S, --scriptdir DIR

Lookup programms in DIR instead of /etc/spoolprocess. This option is repeatable.

-w, --wrapper COMMAND

Prepend COMMAND to handler scripts found in --scriptdir. COMMAND is tokenized by whitespaces. So -w "bash -x" makes script invoked like this for example:

 bash -x /etc/spoolprocess/something spooldir/something.1
-v, --verbose


LIMITATIONS

spoolprocess(1) does not do locking. Run it under flock(1), singleinstance(1), cronrun(1), or similar if you deem it necessary.

DIRECTORY is scanned non-recursively.


SEE ALSO

uniproc(1)

 spoolprocess - process files in a spool directory