:ATTACH_RES
Use the :ATTACH_RES script statement to specify and transfer resources from a Storage (STORE) object to a Windows or UNIX agent. This statement is specifically designed for use on the Process page of Windows or UNIX Job objects (JOBS).
Notes:
- When a Job executes :ATTACH_RES, the agent compiles a list of all designated resource files. If the transfer of any listed file fails, the agent aborts the job.
- While the agent automatically sends operating system, hardware, and platform details to the Automation Engine system, the system strictly transfers only the resources from the Storage object that match these reported parameters. For more information, see Storage (STORE).
- Tip: You can use :ATTACH_RES to transfer resources into a predefined cache directory and then copy them elsewhere using an external script. To easily reference these cache directories, use the
&$AGENT_RESOURCES_CLIENT#and&$AGENT_RESOURCES_TASK#system variables.
Syntax
: ATTACH_RES ObjectName, ResourceName, [Usage], [Variable]
Parameters
| Parameter | Description | Allowed Values |
|---|---|---|
| ObjectName |
Name of the Storage object. |
n.a. |
| ResourceName |
Name of the resource that should be attached and transferred to the agent. Important!
|
n.a. |
| Usage |
(Optional) Determines whether a task-specific or a client-wide cache is used. |
|
| Variable |
(Optional) An Automation Engine variable is replaced by a text-type storage resource just before it is transferred to the agent. Important!
|
|
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