...
JobScheduler can monitor file creation, file change changes and timestamp change changes with a (standalone) job. This job can then start a job chain or job group.
An example how to configure configuration for a "file-watcher":
Code Block | ||
---|---|---|
| ||
<job name = "scheduler_file_notification_1"> <script language="shell"> <![CDATA[ set echo %SCHEDULER_JOB_NAME% echo %SCHEDULER_TASK_TRIGGER_FILES% rem del %SCHEDULER_TASK_TRIGGER_FILES% ]]> </script> <start_when_directory_changed directory = "c:/temp" regex = "^file[1|2]\.xml$"/> </job> |
This job will watch the folder c:/temp on a Windows system. With the The regular expression one can define, what is used to define which file(s) JS has JS to watch. In this example the regex means , that every event regarding involving the files file1.xml and/or file2.xml will fire the execution of the embedded script (which in this case it will echo some values for JS-Environment Variables to stdout).
Every changes change of files in the folder c:/temp which are is matched by the filter ^file1\.xml$ starts a task of for the job.
The environment variable SCHEDULER_TASK_TRIGGER_FILES environment variable contains all the filtered files of in the folder c:/temp in a semicolon separated list which are exist folder at the time where the task is started.
It These files are held in the form of a semicolon separated list. This list doesn't have only just contain the file as value which was changed.
This Note that this behaviour could be critical when two files (e.g. file1.xml and file2.xml) are changed at the same time.
Then two tasks of Two tasks will then be started for the job will start.
In the first task the environment variable SCHEDULER_TASK_TRIGGER_FILES has the value c:/temp/file1.xml;c:/temp/file2.xml
.
In the second task the environment variable SCHEDULER_TASK_TRIGGER_FILES has will have a value that depends on what the first task has done with the files.
If, for example, the first task deletes the files for example then SCHEDULER_TASK_TRIGGER_FILES is will be empty in for the second task.
We For further information we recommend the Directory Monitoring with File Orders.