:REGISTER_OUTPUTFILE
Script statement: Registers a file as an external job output.
Syntax
:REGISTER_OUTPUTFILE File, User login
Syntax |
Description/Format |
---|---|
File |
Fully qualified path and name of the file that should be registered as a job output. Wildcard characters are not allowed. Always specify the absolute path. Format: script literals |
User Login |
Use the user's login. Allowed values: "Y" or "N" Format: script literals |
Comments
You can only use this script statement in the Process tab of UNIX and Windows jobs.
External files can also be registered as job output using the Output Page. The difference lies in the registration time: The files of the Output page are registered immediately when the job is executed, regardless of whether the job could create the file or not. If the script element is used, the specified file is only registered when it is called.
The specified file must be stored on the computer of the agent on which the job is executed or must be accessible from there. It makes sense to only specify files that are generated by the job.
After the job has been executed, the file is listed in the Directory tab and in the report dialog of the default job output. There, the file can be opened or stored directly via the Automic Web Interface.
Examples
The following sample script of a Windows job writes the file list of the directory C:\temp to the file C:\temp\test.txt. The system then verifies whether the command could successfully be executed. If so, this file is registered as job output. Otherwise, the job aborts.
dir C:\temp /S >> C:\temp\test.txt
@set retcode=%errorlevel% !
@if NOT %ERRORLEVEL% == 0 goto :retcode
:REGISTER_OUTPUTFILE "C:\temp\test.txt", "N"
When you define an external interpreter, you need to copy the register.outputfile element to its own client. The Automation Engine will use your version and will not overwrite it when delivering new initial data. A Perl example is shown below:
:if &$EXT_INTERPRETER# = 'PERL' or 'perl' or 'Perl'
system("&UC_JOBMD JNR=&UC_REALNR MNR=&UC_MANDANT PNR=&UC_IP_PORT IPA=&UC_IP_ADR TYP=O ULOGIN=&uc_register_ulogin OUTFILE=\"&uc_register_ofile\"");
:else
...
:endif
See also:
Script Elements - Script Structure and Processing
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function