:ATTACH_RES
Use the :ATTACH_RES script statement to define the resources you want to attach and transfer to the UNIX or Windows Agent with a Storage object.
Prerequisites and Context
This statement is available only on the Process page of Windows or UNIX Job objects (JOBS).
Syntax
:ATTACH_RES ObjectName, ResourceName, [Usage], [Variable]
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| ObjectName | Defines the name of the Storage object. | AE name | n.a. | n.a. |
| ResourceName |
Defines the name of the resource that should be attached and transferred to the agent. Note:
|
Script literal | n.a. | n.a. |
| Usage | (Optional) Determines whether a task-specific or a client-wide cache is used. | Script literal |
|
T |
| Variable |
(Optional) Determines if an Automation Engine variable is replaced by a text-type storage resource just before it is transferred to the agent. Note:
|
Script literal |
|
N[o] |
Important Considerations
Key considerations include:
- In a Job that uses :ATTACH_RES, the agent creates a list of all files that should be transferred. If the transfer of the listed files fails, the agent cancels the job.
- The agent transfers information about the operating system, hardware, and platform to the Automation Engine system. However, the Automation Engine system only transfers those resources from the Storage object that comply with its specified values.
- You can transfer resources into a pre-determined directory using ATTACH_RES and copy the files afterward with an external script. Use the
&$AGENT_RESOURCES_CLIENT#and the&$AGENT_RESOURCES_TASK#system variables for this purpose.
Examples
The following example transfers all the resource files that the specified Storage object contains.
:ATTACH_RES "STORAGE12", "*"
This example transfers all resources whose names start with the term "file".
:ATTACH_RES "STORAGE12", "file*"
The third example transfers all resources into a client-wide cache.
:ATTACH_RES "STORAGE12", "*", C
This example replaces a variable in all files that should be transferred.
:ATTACH_RES "STORAGE12", "*.ini",,Y
The last example uses the &$AGENT_RESOURCES_CLIENT# system variable on the host CURL.EXE for :ATTACH_RES to download a text file from a sample URL. This example would work on every Windows agent, even if CURL were unavailable beforehand.
:ATTACH_RES "PCK.AUTOMIC.STORE", "CURL.EXE", C
"&$AGENT_RESOURCES_CLIENT#CURL.EXE" -O https://www.sampleurl.com/content.txt
See also: