File Watcher Job
File Watcher jobs are used to monitor files and directories using the security profile of the runtime user specified in the job. File Watcher jobs set specific criteria for file monitoring. The job completes successfully when all specified are met.
Note: To use special characters /, \, ^, –, ?, +, (, ), [, ], {, and } in a File Watcher job, add a blackslash (\) before these characters. A backslash functions as an escape character.
Typical Operation:
-
Create a File Watcher job.
Note: Other operations are similar to regular job operations.
File Watcher Job Examples
From the browser, issue and click Manual Commands (Post). Test the REST API examples from the Client Manager API post screen that appears. Likewise, error messages and exceptions are displayed for invalid parameters and unsuccessful execution of a request.
Create a File Watcher Job
The FileWatcherJob object provides a method called create to define a new File Watcher job.
<?xml version="1.0" encoding="UTF-8" ?>
<entry xmlns="http://purl.org/atom/ns#">
<tes:FileWatcherJob.create xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">
<tes:filewatcherjob xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">
<tes:type>18</tes:type>
<tes:name>File Watcher Job</tes:name>
<tes:ownerid>1</tes:ownerid>
<tes:active>Y</tes:active>
<tes:directory>/opt</tes:directory>
<tes:filemask>*.txt</tes:filemask>
<tes:filematchall>T</tes:filematchall>
<tes:searchrecursive>T</tes:searchrecursive>
<tes:polllifetime tes:null="Y"/>
<tes:polllifetime>60</tes:polllifetime>
<tes:polllifetimeunit>second</tes:polllifetimeunit>
<tes:pollinterval>2000</tes:pollinterval>
<tes:pollintervalunit>millisecond</tes:pollintervalunit>
<tes:existence>T</tes:existence>
<tes:filesizecondition>File_Size</tes:filesizecondition>
<tes:filesize>1024</tes:filesize>
<tes:fileactivity>File_Stable</tes:fileactivity>
<tes:activitytimespan>123</tes:activitytimespan>
<tes:activitytimespanunit>millisecond</tes:activitytimespanunit>
<tes:extendedinfo tes:null="Y"/>
</tes:filewatcherjob>
</tes:FileWatcherJob.create>
</entry>