Table of Contents

Search

  1. Preface
  2. Informatica Managed File Transfer Welcome Overview
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Example 2: Execute SSH Command Using Environment Variables

Example 2: Execute SSH Command Using Environment Variables

The Execute SSH Command can pass values to Environment Variables for use in commands and scripts on the SSH server. When the task executes, the value of the environment variables will be passed to the SSH server before the SSH command is executed. The task supports the use of multiple environment variables.
Environment Variable Names must be defined within the AcceptEnv keyword section of the SSHD_CONFIG file on the SSH Server. When the SSH session is opened, the SSH server passes the accepted environment variable names to
Managed File Transfer
.
Managed File Transfer
then uses the Environment Variables element to assign a value to the variable.
The following example uses the LC_NAME environment variable to pass in the value of the search attribute in the grep command. When the task executes, the SSH server will search for files that contain the name "kharris" in the /root/Public directory and then write the results to a file.
  1. From within the Project Designer page, navigate to the
    Application
    Native Calls
    folder in the Component Library, and then drag the Execute SSH Command task to the Project Outline.
  2. On the Basic tab of the Execute SSH Command task, specify the SSH Server and Command:
    SSH Server
    Select a pre-configured SSH server from the drop-down list.
    Command
    Specify the command to execute on the remote system. Note: The "$LC_NAME" environment variable is used in the command. A value for the LC_NAME variable will be created in step 6 below.
  3. On the Advanced tab, specify where the output of the command will be redirected to:
    Redirect Output To
    Specify where the standard output from the command, if any, will be directed. By default, the output will be written to the job log.
    Output File
    Specify the output file path and name of where you want the output written to. This is required when redirecting output to a file.
  4. Click the
    Add
    button and select the Environment Variable menu item.
  5. On the Basic tab of the Environment Variables element, specify values for the following attributes:
    Name
    A name for the environment variable.
    Value
    The value of the environment variable.
  6. Click the
    Save
    button when finished.

0 COMMENTS

We’d like to hear from you!