Hitachi

JP1 Version 12 JP1/Automatic Operation Service Template Reference


4.13.22 Compressing a file

Function

This plug-in compresses the specified file or folder on the execution-target server in a Windows or UNIX environment. If the OS of the execution-target server is Windows, the plug-in compresses the specified file or folder in ZIP format, and the resulting compressed file will have the extension .ZIP. If the OS is UNIX, the plug-in first archives the specified file or folder into a TAR file and then compresses the TAR file in GZIP format, and the resulting compressed file will have the extension .TGZ. The name of the resulting compressed file is the target file name (in Windows, the file name excluding the extension) to which the appropriate extension has been appended, and the compressed file is output to the output destination folder at the path specified by the common.outputDestFolderPath property. The compression-target files or folders in the path specified by the common.compressSourceFilePath property are not deleted after being compressed. The value of the common.compressSourceFilePath property cannot include wildcard characters.

Notes on the compression-target file path (common.compressSourceFilePath property):

- Specify the compression-target file or folder by its full path name.

Notes on the output destination folder path (common.outputDestFolderPath property):

- Specify the output destination folder by its full path name. If the specified folder does not exist, it will be automatically created.

Use situation

This plug-in can be used to compress data (such as log files) and transfer the compressed data to another server.

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]

If the OS of the execution-target server is Windows, .NET Framework 4.5.2 (or later) and Windows PowerShell 3.0 (or later) must be installed.

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 UNIX, do not include single-byte backslashes (\) in the values of properties.

(3) You cannot specify multiple files or folders for the compression-target file path (common.compressSourceFilePath property).

(4) You cannot specify shortcuts or symbolic links as the compression target (common.compressSourceFilePath property).

(5) If the OS of the execution-target server is Windows, do not specify any folder that contains a symbolic link to an upper-level folder for the compression-target file path (common.compressSourceFilePath property). If you specify such a folder, the plug-in terminates abnormally.

(6) If the compression command fails on a UNIX execution-target server, the plug-in creates a file named "jp1ao_plug-in_error.log" in the output destination folder (specified by the common.outputDestFolderPath property), and then outputs error details to the file. If this file is unnecessary, delete it. Note that the jp1ao_plug-in_error.log file will be overwritten with a new file.

(7) If the plug-in terminates abnormally and the following error message appears in the task log, remove the cause of the error by referring to jp1ao_plug-in_error.log:

KNAE08132-E Processing was interrupted because the size of the standard output for a command exceeded the upper limit (upper limit: 100 KB).

(8) If the OS of the execution-target server is Windows, you cannot specify a drive path as the compression-target file path (common.compressSourceFilePath property). If the OS is UNIX, you cannot specify the root path as the compression-target file path.

(9) When specifying the output destination folder path (common.outputDestFolderPath property), do not specify the folder in the compression-target file path (common.compressSourceFilePath property) or any subfolder of that folder. If you specify a folder or subfolder in the compression-target file path, the plug-in terminates abnormally.

(10) If the output destination folder (specified by the common.outputDestFolderPath property) already contains a file that has the same name as the compressed file to be created, this plug-in terminates abnormally without overwriting the existing file.

(11) If the OS of the execution-target server is Windows, the length of the output destination folder path must not exceed 247 characters, and the total length of the folder path and file name must not exceed 259 characters. If the specified path is too long, the plug-in cannot compress the file.

(12) Whether a file can be compressed depends on the size of installed memory. If a file is too large to be compressed, store it in a folder, and then compress the folder.

(13) This plug-in must wait until compression finishes for synchronization.

(14) The time required for compression depends on the file size.

Version

02.00.00

Plug-in tags

Control OS,Windows,Linux

Plug-in name displayed in the task log

osCompressFile

Return code

0: Normal

12: Error (Mistake by user) Invalid property

23: Error (Invalid environment) The environment requirements are not met.

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.compressSourceFilePath

File path to be compressed

Enter the full path of the file or folder to be compressed.

--

Input

R

common.outputDestFolderPath

Folder output path

Enter the full path of the folder output path.

--

Input

R

common.returnCompressFilePath

Compressed file path

This is the full path of the stored compressed file.

--

Output

--

common.returnValue

Return value for the plugin

The return value of this plugin stored.

--

Output

--