2.6 Registering a job executed on event
The example in 2.2 Creating a job runs a job immediately and the example in 2.5 Setting a schedule runs a job at a specified time. In addition to them, you can configure a job to run when a specified event occurs.
This example configures a job to monitor a file event and then copy the file when the file is created.
Specifically, when the text file c:\temp\test.txt is created, the job copies it to c:\temp\backup.txt.
Procedure
-
In the Job Design View, click the Exec. on event tab.
-
Click the (New) button.
The Job exec. on event dialog box appears.
-
Enter the job name and description.
- Example
-
Job name: TEST01
Details: File Copy
-
Under Select item, select the Action tab.
-
Select the Command execution item, and then click the Apply button.
-
Enter the execution command, the parameter and the virtual user name.
- Example
-
Execution command: cmd.exe
Parameter: /c copy c:\temp\test.txt c:\temp\backup.txt
Virtual user name: Virtual user name#
- #
-
If you want to execute the command as a specific Windows user, specify the name of a virtual user associated with that Windows user. If this is omitted, the command is executed with the account for the CPA job execution service. For details on the virtual user name, see the manual JP1/Client Process Automation Configuration and Administration Guide.
-
Under Select item, select the Exec. Condition tab.
-
Select the Monitor file event item.
-
Click the Apply button.
-
Enter the name of the file you want to monitor, the monitoring condition and virtual user name.
- Example
-
File name to be monitored: c:\temp\test.txt
Monitoring condition: Create
Virtual user name: Virtual user name#
- #
-
If you want to monitor the file as a specific Windows user, specify the name of a virtual user associated with that Windows user. If this is omitted, the command is executed with the account for the CPA job execution service. For details on the virtual user name, see the manual JP1/Client Process Automation Configuration and Administration Guide.
-
Click the Register button.
A message appears indicating the completion of the registration.
-
Click the OK button.
Now the job executed on event is registered.
Create the test file c:\temp\test.txt, and then check whether the file is copied.