:REGISTER_OUTPUTFILE

Use the :REGISTER_OUTPUTFILE script statement on the Process page of UNIX and Windows Jobs to register a file as an external job output. The specified file must be stored on the agent's computer on which the job is executed or must be accessible from there. It makes sense only to define files that are generated by the job. After the job has been executed, the file is listed in the Directory tab and the report dialog of the default job output. There, you can open or store the file directly via the Automic Web Interface. For more information, see Registered Job Output.

Note: Using the Output page, you can also register external files as job output. 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. If you use this script statement, the specified file is only registered when it is called. For more information, see Registering External Output Files.

Syntax

:REGISTER_OUTPUTFILE File, User login

Parameters

  • :REGISTER_OUTPUTFILE
    Registers a file as an external job output
  • File
    Fully qualified path and name of the file that should be registered as a job output. Wildcard characters are not allowed. You must always specify the absolute path.
    Format: script literal
  • User login
    Defines whether the user's login data should be used
    Allowed values: 
    • Y
    • N
    Format: script literal  

Examples

The following sample script of a Windows job writes the file list of the C:\temp directory 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 must copy the register.outputfile element to its own client. The Automation Engine uses your version and does not overwrite it when delivering new initial data. See the Perl example 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: