<file-monitor-process>
Purpose/Function
Extension to <stream-monitor-process>
which allows one to attach a monitor which checks for the appearance and/or update of files. Like the stream monitors, the file monitor is automatically started and stopped with the start and termination of the process.
Attributes
NAME |
TYPE |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|---|
dumpEnvironment |
|
false |
print the environment to a file before executing (for debugging purposes) |
executionDir |
|
|
execute in this directory |
inFile |
|
|
redirect stdin to process from this file |
inheritEnvironment |
|
true |
run process in parent's environment |
Elements
TAG |
TYPE |
COUNT |
DESCRIPTION |
---|---|---|---|
|
|
0:1 |
command to execute |
|
|
0:1 |
list of environment variable definitions (name=value); if inheritEnvironment is true, these are added to the parent environment; if not, they constitute the new environment |
|
|
0:1 |
attach this monitor to the error stream |
|
|
0:1 |
attach this monitor to the output stream |
|
|
0:1 |
attach this monitor to the process which is producing/updating files |
ReturnValues
None.
NOTES
For further explanation of triggers and triggered actions on streams, see under StreamMonitorTrigger and StreamSegmentTriggeredAction; similarly for triggers and triggered actions on files, under FileMonitorTrigger and FileMetadataTriggeredAction.
Examples
<ogrescript> ... <file-monitor-process execution-dir="${runtime.dir}"> <command-line>${runtime.dir}/testprocess.sh</command-line> <out-monitor> <trigger> <filter pattern=".*"/> <actions> <stream-progress-action topic="TROLL"/> </actions> </trigger> </out-monitor> <file-monitor> <pattern base="file:${runtime.dir}"> <exclude>target</exclude> </pattern> <new-file-queued-trigger> <filter pattern=".*.txt"/> <actions> <file-progress-action topic="TROLL"/> <file-copy-action targetDir="file:${runtime.dir}/target"/> </actions> </new-file-queued-trigger> </file-monitor> </file-monitor-process> ... </ogrescript>