Overview
This flow facilitates the execution of a shell script on a remote host via an SSH connection. The command line interpreter used for executing the script depends on the operating system of the remote host. Typically, sh
or bash
is used for Linux systems, while cmd
is used for Windows systems.
When to use this Flow type
- For orchestration. Yes, Etlworks is the best orchestration tool around.
- For triggering services running on a remote host.
- For committing and pushing changes to an external version control, for example GitHub.
- For running Python programs using the Python installed in the remote host.
Also read about executing scripts in the operating system hosting Etlworks instance.
Create Flow
Step 1. Create and test SSH connection.
Step 2. Start creating a Flow
by typing ssh
into the Select Flow Type
box. Select Execute script in the remote host using SSH
.
Step 3. Select SSH connection created in step 1.
Step 4. Continue by entering the script code in Script to execute or Path to Script
field in the Parameters
tab.
Read how to execute a script file that already exists in the file system of the remote host.
Step 5. Enter other parameters if needed (optional):
Success mask
: enter string or a part of the string which, if found in the output, will indicate that the Flow executed successfully.Error mask
: enter string or a part of the string which, if found in the output, will indicate that the Flow executed with error.Keep log
: if option is selected (default), the system will add the log produced by executing the script to the Flow log.Execute before
: the JavaScript or Python program that will be executed before executing a command-line script. You can use it to set the global variables that can be referenced as{parameters}
in the command line script. You can also use it to conditionally disable the command-line script Flow.On Exception
: by default, any error causes a halt of execution. Whenignore
is selected, the errors will be ignored and execution will continue. Read how to configure the Flow to ignore all or specific exceptions.Exception Mask
: you can specify what errors should be ignored and still halt the execution for all other errors. Enter part or all of the exception string. This field works only when theIgnore On Exception
option is selected.Execute if Error
: if this option is selected and an error occurs, Etlworks will execute this script code.
Step 6. Optionally enter flow variables as key-value pairs.
The flow variables can be referenced as {VAR_NAME}
anywhere in the command line script.
Execute a script file which already exists in the file system of the remote host
If you want to execute the existing script just enter the full (or relative to the user's home folder) path to the script file in the remote host and enable Is Path to Script
.
Comments
0 comments
Please sign in to leave a comment.