Hitachi

JP1 Version 12 JP1/Automatic Job Management System 3 System Design (Work Tasks) Guide


7.6.2 Notes on the Monitoring Files job

The following provides precautions (items you should know in advance) for using the Monitoring Files job.

Examples of jobnets that use the Monitoring Files job are as follows:

The following paragraphs describe the events that are monitored by the Monitoring Files job, how to specify file names, and the options of the Monitoring Files job.

Organization of this subsection

(1) Events monitored by the Monitoring Files job

The following table lists the events that can be monitored.

Table 7‒2: Events monitored by the Monitoring Files job

Monitored event

Details

Create#1, #2

Monitors whether a file with the specified name has been created.

Delete#3

Monitors whether a file with the specified name has been deleted.

Change size#2, #4

Monitors whether the size of a file with the specified name has been changed.

Final time write#2, #4

Monitors whether a file with the specified name has been updated. The start condition is satisfied when the update time changes.

#1

If a file with the specified name already exists when monitoring starts, the condition is satisfied when the old file is deleted and a new file is created.

You can use the start monitoring option to specify whether the condition is satisfied if a file with the specified name already exists when monitoring starts. For details about the start monitoring option, see (3) Options of the Monitoring Files job.

#2

If the monitoring condition is satisfied, the system performs a close check to make sure the monitored file is not being accessed by any process other than the Monitoring files job.

If another process is accessing the file, the condition is judged to be unsatisfied, and another close check is performed when the next monitoring interval occurs. If the file is not being accessed by a process other than the Monitoring files job, the condition is judged to have been satisfied. The close check prevents the job from assuming that the condition is satisfied before the transmission (for example, copying) of a monitored file has been completed.

#3

If a file with the specified name does not exist when monitoring starts, the condition is satisfied when a new file with the specified name is created and then deleted.

#4

If the file with the specified name does not exist when monitoring starts, the condition is satisfied when a new file with the specified name is created and the size of the file or the last write time is changed. Simply creating a file does not satisfy the condition.

You can specify multiple conditions simultaneously. For example, specify Delete and Final time write if you want to execute the succeeding job when the file is deleted or updated. However, you cannot specify Change size and Final time write simultaneously.

The following figures show the basic operation of the Monitoring Files job.

(a) Example with "Create" specified as a monitoring condition

The following figure shows the basic operation of the Monitoring Files job when Create is specified as a monitoring condition.

The term File in the figure refers to the files being monitored by the Monitoring Files job.

■ When the monitoring target file does not exist at the start of the job

The Monitoring Files job behaves as follows when the monitoring target file does not exist when the job starts.

Figure 7‒3: When the monitoring target file does not exist at the start of the job

[Figure]

■ When the monitoring target file exists at the start of the job

The Monitoring Files job behaves as follows when the monitoring target file already exists when the job starts.

Figure 7‒4: When the monitoring target file exists at the start of the job

[Figure]

(b) Example with "Delete", "Change size", or "Final time write" specified as a monitoring condition

The following figure shows the basic operation of the Monitoring Files job when Delete, Change size, or Final time write is specified as a monitoring condition. This particular example uses Delete as the start condition.

■ When the monitoring target file does not exist at the start of the job

The Monitoring Files job behaves as follows when the monitoring target file does not exist when the job starts.

Figure 7‒5: When the monitoring target file does not exist at the start of the job

[Figure]

■ When the monitoring target file exists at the start of the job

The Monitoring Files job behaves as follows when the monitoring target file already exists when the job starts.

Figure 7‒6: When the monitoring target file exists at the start of the job

[Figure]

(c) Example when multiple events occur during a monitoring interval (when the monitoring condition is "Create")

The following figure shows the basic operation of a Monitoring Files job that uses the Create start condition, in a situation where a file is updated multiple times in one monitoring interval.

■ Example when file creation is not detected

The Monitoring Files job behaves as follows when file creation is not detected.

Figure 7‒7: Example when file creation is not detected

[Figure]

■ Example when file creation is detected

The Monitoring Files job behaves as follows when file creation is detected.

Figure 7‒8: Example when file creation is detected

[Figure]

(2) Specifying file names

To specify a file name, you can use an absolute path or wildcard characters consisting of an absolute path and a wildcard (*). The following table lists examples of using wildcards to specify file names.

Table 7‒3: Examples of using wildcards to specify the names of files to be monitored

Example

Files specified

Examples of monitored files

/jp1/*

All the files in /jp1 are monitored, except files whose name begins with a period (.).

/jp1/aaa

/jp1/aaa.sh

/jp1/.*

All the files in /jp1 whose name begins with a period (.) are monitored.

/jp1/.aaa

/jp1/aaa*

All the files in /jp1 whose name begins with the character string aaa are monitored.

/jp1/aaa

/jp1/aaabbb

/jp1/aaa.sh

/jp1/*aaa

All the files in /jp1 whose name ends with the character string aaa are monitored.

/jp1/aaa

/jp1/bbbaaa

/jp1/bbb.aaa

/jp1/aaa*bbb

All the files in /jp1 whose name begins with the character string aaa and ends with the character string bbb are monitored.

/jp1/aaabbb

/jp1/aaacccbbb

/jp1/aaa.bbb

/jp1/*aaa*

All the files in /jp1 whose name contains the character string aaa are monitored.

/jp1/aaa

/jp1/bbbaaa

/jp1/bbbaaaccc

/jp1/bbbaaa.sh

Note

The file name examples in the above table are for UNIX. When you specify a file name for Windows, it appears in the format c:\jp1\*. An error occurs at execution of the Monitoring Files job in the following cases:

  • A wildcard is specified in a directory name.

  • A relative path is specified.

  • The specified file name already exists as a directory (for example, when you specify file name /jp1/aaa, but directory /jp1/aaa already exists).

  • The parent directory of the file name including the wildcard does not exist (for example, when you specify file name /jp1/*, but directory /jp1/ does not exist).

(3) Options of the Monitoring Files job

You can specify the following two options for the Monitoring Files job:

Details of each option are given below.

(a) Start monitoring option

You can use the start monitoring option to specify whether the monitoring condition of the Monitoring Files job is satisfied if the target file already exists when the job starts executing.

The start monitoring option takes effect when you select Create as the monitoring condition. If you do not specify this option, the monitoring condition is not satisfied even if the target file exists.

The following examples illustrate how the Monitoring Files job behaves depending on the setting of the start monitoring option.

■ Operation when the start monitoring option is disabled

The figure below shows the operation of the Monitoring Files job when the start monitoring option is disabled.

The term File in the figure refers to the files being monitored by the Monitoring Files job.

If the monitoring target file is created before the Monitoring Files job is executed

The Monitoring Files job behaves as follows when the monitoring target file is created before the job is executed.

Figure 7‒9: Operation when the monitoring target file is created before the Monitoring Files job executes

[Figure]

If the monitoring target file is created after the Monitoring Files job is executed

The Monitoring Files job behaves as follows when the monitoring target file is created after the job is executed.

Figure 7‒10: Operation when the monitoring target file is created after the Monitoring Files job executes

[Figure]

■ Operation when the start monitoring option is enabled

The figure below shows the operation of the Monitoring Files job when the start monitoring option is enabled.

If the monitoring target file is created before the Monitoring Files job is executed

The Monitoring Files job behaves as follows when the monitoring target file is created before the job is executed.

Figure 7‒11: Operation when the monitoring target file is created before the Monitoring Files job executes

[Figure]

If the monitoring target file is created after the Monitoring Files job is executed

The Monitoring Files job behaves as follows when the monitoring target file is created after the job is executed.

Figure 7‒12: Operation when the monitoring target file is created after the Monitoring Files job executes

[Figure]

See the following for details about how the Monitoring Files job behaves depending on the specification of the start monitoring option.

When Establish for existing files is specified

When the Monitoring Files job is executed with Create specified as the monitoring condition, if the target file already exists, the monitoring condition is satisfied and the Monitoring Files job terminates normally. A close check ensures that if the file is in use when the Monitoring Files job is executed, the job remains in Now monitoring status until the target file is no longer being used.

When the start monitoring option is specified, the monitoring condition is satisfied differently depending on the type of the Monitoring Files job, as follows:

Monitoring Files job in a jobnet with a monitoring target file name specified

If the monitoring target file exists when the Monitoring Files job is executed, the monitoring condition is satisfied by the start monitoring option. The event occurs immediately, and the Monitoring Files job terminates normally.

Figure 7‒13: Monitoring Files job in a jobnet with a monitoring target file name specified

[Figure]

Monitoring Files job in a jobnet with a monitoring target file name specified using a wildcard (*):

If at least one file exists in the monitoring target directory when the Monitoring Files job is executed, the monitoring condition is satisfied by the start monitoring option. The event occurs immediately, and the Monitoring Files job terminates normally.

Figure 7‒14: Monitoring Files job in a jobnet with a monitoring target file name specified using a wildcard (*)

[Figure]

Supplementary note:

For details about wildcard usage, see (2) Specifying file names.

Monitoring Files job in a start condition with a monitoring target file name specified

If the monitoring target file exists at execution of a Monitoring Files job that serves as a start condition, the monitoring condition is satisfied by the start monitoring option, and the event occurs immediately.

The start monitoring option is disabled once an event occurs. After the event occurs, the Monitoring Files job continues monitoring in the Now monitoring status. However, after the option is disabled, a condition is satisfied when a new file is created.

Figure 7‒15: Monitoring Files job in a start condition with a monitoring target file name specified

[Figure]

Monitoring Files job in a start condition with a monitoring target file name specified by a wildcard (*)

While the Monitoring Files job in the start condition is executed, a monitoring condition is satisfied for any file in the monitoring target directory by the start monitoring option, and an event occurs immediately.

The start monitoring option is disabled after events occur for each of the files. After events occur, the Monitoring Files job continues monitoring in the Now monitoring status. However, after the option is disabled, a condition is satisfied when a new file is created.

Figure 7‒16: Monitoring Files job in a start condition with a monitoring target file name specified by wildcard (*)

[Figure]

Supplementary note:

For details about wildcard usage, see (2) Specifying file names.

When Establish at file creation is specified (default)

When a Monitoring Files job with Create specified as the monitoring condition is executed, the monitoring condition is not satisfied even if the monitoring target file exists when the job enters Now running status. The Monitoring Files job continues monitoring.

When JP1/AJS3 is used in a cluster system, any Monitoring Files job with the start monitoring option specified will be re-executed after failover of the JP1/AJS3 service. If the Monitoring Files job status passing option is enabled, the job retains the same status as before the failover. If this option is disabled, the start monitoring option applies once again.

For details about how to specify the start monitoring option of the Monitoring Files job, see 12.4.19 Detailed Definition - [Monitoring Files] dialog box in the JP1/Automatic Job Management System 3 Operator's Guide or 5.2.10 File monitoring job definition in the manual JP1/Automatic Job Management System 3 Command Reference.

(b) Monitoring Files job status passing option

You can save the information about the file monitoring performed by the Monitoring Files job as needed, and pass the status to a later instance of the job. If you enable the status passing option, a status passing information file is created for each Monitoring Files job.

For example, suppose that the JP1/AJS3 service stops in a cluster system while a Monitoring Files job is running. If the same Monitoring Files job is executed after the JP1/AJS3 service restarts, it inherits the previous monitoring status. A Monitoring Files job can inherit previous information even in a non-cluster system.

The monitoring status can be passed only if the Monitoring Files job continues running. Whether the monitoring status is passed depends on whether the Monitoring Files job runs continuously, or terminates.

The following table shows the conditions for passing the monitoring status.

Table 7‒4: Conditions for passing the monitoring status

Type of Monitoring Files job

Restart of JP1/AJS3 service

Failover followed by a stop

Failover due to system going down

Monitoring Files job in a jobnet

Not passed because the job terminates#.

Not passed because the job terminates#.

Passed.

Monitoring Files job in a start condition

Passed.

Passed.

Passed.

#

If a failover that requires the JP1/AJS3 service on the execution agent to be either restarted or stopped occurs, Table 7-4 applies even if the option to continue execution of active event jobs is enabled. This is because the file monitoring jobs are stopped during the failover. As a result, no events can be detected from the time the JP1/AJS service is stopped on the execution agent on which the file monitoring jobs are running until the service is restarted and event monitoring is resumed.

At this time, the messages KAVT2031-E and KAVT2034-W are output to the integrated trace log on the execution agent. If the option to continue execution of active event jobs is enabled, ignore these messages and continue operation. For details about the option to continue execution of active event jobs, see 8.2.1 Continuing the execution of event jobs if the JP1/AJS3 service stops in the JP1/Automatic Job Management System 3 Administration Guide.

The status passing information file is deleted in the following cases:

  • The status passing information file created for each Monitoring Files job is deleted when the Monitoring Files job terminates.

  • If you disable status passing after status information has been passed, all the status passing information files are deleted.

  • If you start the JP1/AJS3 service with the cold option, all the status passing information files are deleted.

The following figure shows an example of operation when the status passing option of the Monitoring Files job is enabled.

Figure 7‒17: Example of operation when the status passing option of the Monitoring Files job is enabled

[Figure]

The functionality for passing the status of the Monitoring Files job is disabled by default. To enable the functionality, perform the setting procedure for all the hosts and nodes that execute the Monitoring Files job. In a cluster system, both the primary node and the secondary node require the setting. For details about the setting procedure, see 6.3.3 Setting the status passing option for the file monitoring job in the JP1/Automatic Job Management System 3 Configuration Guide (for Windows hosts) or 15.3.3 Setting the status passing option for the file monitoring job in the JP1/Automatic Job Management System 3 Configuration Guide (for UNIX hosts).

Note that if you change the setting for monitoring files that exceed 2 gigabytes (large file support) from yes to no, and a job inherits status passing information for a file larger than 2 gigabytes, the message KAVT2038-E is output to the integrated trace log and to the execution result details, and the job ends abnormally.

(4) Notes on defining the Monitoring Files job

Note the following when you define the Monitoring Files job: