Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

How to send files with the action "Send Files with SCP"

    Introduction

    Stambia Data Integration allows to work with SSH servers.

    In order to transfer one file or multiple files to a remote server, you can use the action "Send Files with SCP".


    Note:

    Stambia DI is a flexible and agile solution. It can be quickly adapted to your needs.

    If you have any question, any feature request or any issue, do not hesitate to contact us.

    To transfer multiple files

    To transfer multiple files, you have to use two parameters:

    "Scp Local Dir": Path to the local directory containing files to transfer.

    "Scp File Includes": Path to the list of files to include. This is a semi-colon separated list of files masks.

     Example:

    To transfer all files with extension .json stored in the local dir C:\Test\Files

     

    image1

    TO TRANSFER ONE FILE

    In order to transfer one file, you have to use just one parameter:

    "Scp Local File": Path to the Local file name.

    Example:

    To transfer the file "toto.json" stored in C:\Test\Files

    image2

     

     

     

     

     

     

     

    Stambia DI for SSH

      Stambia Data Integration allows to work with SSH servers.

      A SSH Metadata is available to define all the server's credentials and communication properties, and to specify distant SSH folders.

      It can then be used with the dedicated SSH Process Action to execute commands on remote systems through SSH.

      Read more: Stambia DI for SSH

      How to use an SSH Server

        Introduction

        In Stambia, SSH Metadatas can be created to manipulate SSH, SCP and SFTP protocols.

        They can be used in processes with actions like Execute SSH , Send Files with SCP or Get Files with SCP.

        We are going to see in this article how to configure such a metadata, and how to use it in basic processes.

         

        Creating and configuring an SSH Metadata

        The SSH Metadata can be found in metadata creation window, and is named SSH Server.

        The configuration is located on the node of the metadata.

        Example:

        ssh03

        Note :

        • Private Key File parameter is the path to the private ssh key
        • Password phrase parameter is the passphrase of the ssh key, if there is one
        • Additional Connection Properties parameter allows to define additional connection properties in the form of Java Properties. (key=value lines separated with line returns)

         

        Next, we can add folders to this metadata with Right click > new > remote directory. These folders can be used in processes to fill automatically action parameters.

        directory

         

        Using the Metadata in a Process

        Process overview:

        processOverview

        SSH process actions can be easily used with the metadata. All the connections settings are filled automatically when the metadata nodes are dragged and dropped on them.

        It is possible to use directly a folder, like on SCP action for example. The SCP_REMOTE_DIR will be filled too.

        Note :

        It is a better practice to use metadatas instead of defining all the parameters on each actions. It permits to simplify a lot the maintenance, debug, and update of your work, but also to apply Configurations to use and test different settings very easily.

        For more informations about configurations, you can read Working with Configurations in the Stambia Designer Help Content.

         

        Execute SSH Action

        The first action in the process is used to send ssh commands to the server. They are put in the body of the action :

        sshActionFinal

        The Execute SSH action opens a non-interactive shell session on the remote server.

        - Keep in mind that this kind of session does not load the user's environement and profile scripts

        - See your shell's documentation for more information (documentation for bash)

        - An easy way to load environment variables is to "source /home/user/some_config.sh" as the first line of the Action Code

        Send files with SCP Action

        The second action is used to send files with SCP.

        The SCP remote dir is the directory in which files will be sent.

        The SCP Local File is path to the file you want to send.

        See the Designer's Help for more information about each parameters.

         

        Articles

        Suggest a new Article!