Hitachi

JP1 Version 12 JP1/Automatic Operation Service Template Reference


4.13.24 Obtaining the latest update time stamp of a file

Function

This plug-in outputs the time when a file or folder (at a specified path) was last updated to a property.

The path is specified by the common.targetPath property. The value of this property cannot include wildcard characters.

Notes on the format of the time of last update (common.lastModifiedDateFormat property):

- Specify a character string whose length does not exceed 64 characters for the common.lastModifiedDateFormat property.

- The conversion specifiers included in the specified character string are converted to their corresponding values.

Characters other than conversion specifiers are stored in the property as is.

The following are examples of conversion specifiers.

Examples of conversion specifiers:

%Y: Four-digit year (according to the Western calendar, including the century).

%y: Last two digits of the year (according to the Western calendar, excluding the century). A zero is prefixed to one-digit values.

%m: Month. A zero is prefixed to one-digit values.

%d: Day. A zero is prefixed to one-digit values.

%H: Hour in 24-hour notation. A zero is prefixed to one-digit values.

%I: Hour in 12-hour notation. A zero is prefixed to one-digit values.

%M: Minute. A zero is prefixed to one-digit values.

%S: Second. A zero is prefixed to one-digit values.

%s: Number of seconds from 1970-01-01 00:00:00 UTC

If the common.waitFileModifiedForChange property is set to "true", the file update check function is enabled. This function checks whether the time when a file or folder was last updated has been changed from the first-obtained value. This check is performed at the interval specified by the common.waitFileModifiedInterval property (in seconds), for the number of times specified by the common.waitFileModifiedCount property. If the time of last update is changed during the time it takes to perform the check the specified number of times, the plug-in outputs the newest time of last update to the OS.lastModifiedDate property. Then, the plug-in sets the common.reacquisitionResultLastModifiedDate property to "true" (indicating that the time of last update was obtained again) and then terminates normally. If the time of last update does not change during the time it takes to perform the check the specified number of times, the plug-in outputs the time of last update that was obtained first to the common.lastModifiedDate property, sets the commonreacquisitionResultLastModifiedDate property to "false", and then terminates normally.

If the value of the common.waitFileModifiedForChange property is not "true", the plug-in outputs the time when the specified file or folder was last updated to the common.lastModifiedDate property, sets the common.reacquisitionResultLastModifiedDate property to "false", and then terminates normally.

Use situation

- This plug-in can be used to check whether files to be updated by another plug-in have been updated.

- When a plug-in is to be executed after a file has been updated by another system, this plug-in can be used to suppress the start of the execution of that plug-in until the file update finishes.

Prerequisites

For the most recent information about the prerequisite products in the system, the prerequisite products on the execution-target server, and the supported OSs on the execution-target server, see the Release Notes.

[Prerequisite products in the system]

JP1/Automatic Operation 11-00 or later

[Prerequisite products on the execution-target server]

None.

[Supported OSs on the execution-target server]

(1) Windows Server 2008 R2 Standard/Enterprise/Datacenter

(2) Windows Server 2012 Standard/Datacenter or Windows Server 2012 R2 Standard/Datacenter

(3) Windows Server 2016 Standard/Datacenter

(4) Windows Server 2019 Standard/Datacenter

(5) Red Hat Enterprise Linux Server 6 (32-bit x86) or Red Hat Enterprise Linux Server 6 (64-bit x86_64)

(6) Red Hat Enterprise Linux Server 7 (64-bit x86_64)

(7) Red Hat Enterprise Linux Server 8 (64-bit x86_64)

(8) CentOS 6 (64-bit x86_64)

(9) CentOS 7 (64-bit x86_64)

(10) CentOS 8 (64-bit x86_64)

(11) Oracle Linux 8 (64-bit x86_64)

[Conditions for using the execution-target server]

None.

Cautions

(1) For the properties of this plug-in, do not specify any strings that include double quotation marks (") or single quotation marks (').

(2) If the OS of the execution-target server is Windows, do not include curly brackets ({}) in the value of the OS.lastModifiedDateFormat property, which specifies the format of the time of last update. If you do so, this plug-in terminates abnormally.

(3) The functional description does not cover all conversion specifiers that can be used. For a list of all conversion specifiers that can be used, see the manual for the Get-Date commandlet for PowerShell if the OS of the execution-target server is Windows, or the manual for the "date" command if the OS of the execution-target server is UNIX. However, do not use conversion specifiers that will be converted into control characters such as %n and %t.

(4) Be careful when you want to output a percent sign (%) to the OS.lastModifiedDate property (last file update time). In such cases, use "%%" instead of "%" in the value of the OS.lastModifiedDateFormat property, which specifies the format of the time of last update.

(5) If the OS of the execution-target server is Windows, do not specify only a percent sign (%) for lastModifiedDateFormat. If you do so, the plug-in terminates abnormally.

Version

02.00.00

Plug-in tags

Gather OS information,Windows,Linux

Plug-in name displayed in the task log

osGetModifiedDate

Return code

0: Normal

12: Error (Mistake by user) Invalid property

27: Error (Check with the task log about the error detail) Unidentified error

41: Error (An error has been detected in the plug-in) Property not entered (An error has been detected in the component script)

Property list

The following table lists the properties:

Property key

Property name

Description

Default value

I/O type

Required

plugin.destinationHost

Host name of the execution target server

Specify the host name or IP address of the server on which this plugin will be executed. IPv6 addresses are not supported.

--

Input

R

common.targetPath

Target path

Enter the full path of the target file or folder.

--

Input

R

common.lastModifiedDateFormat

Format of the latest update time stamp

Specify the format of the latest update time stamp of the specified file or folder.

%Y-%m-%dT%H:%M

Input

R

common.waitFileModifiedForChange

Whether to wait for file updates

Specify "true" to wait for the specified file or folder to update. If "true" is not specified, the processing ends without waiting for the folder to update, and the latest update time stamp is output.

false

Input

O

common.waitFileModifiedCount

Number of times to check for file updates

Specify the number of times to check the specified file or folder updates in the range from 1 to 192. You must specify the number if you want to wait for file updates.

--

Input

O

common.waitFileModifiedInterval

Interval for checking for file updates

Specify the time interval for checking the specified file or folder updates in the range from 1 to 3600 (seconds). You must specify an interval if you want to wait for file updates.

--

Input

O

common.returnValue

Return value for the plugin

The return value of this plugin stored.

--

Output

--

common.lastModifiedDate

Latest update time stamp of a file

The latest update time stamp of the specified file or folder is stored in the defined format.

--

Output

--

common.reacquisitionResultLastModifiedDate

Results of the re-acquisition of the latest update time stamp

If the latest update time stamp is re-acquired, "true" will be stored. If not, "false" will be stored.

--

Output

--