Skip to main content
Skip table of contents

Shell operations

RunCommand operation

  • Executes a shell command in a Unix environment using `/bin/sh`.

  • The environment user executes the command from their home directory.

  • The Delphix Continuous Data Engine captures and logs all command output.

  • In case of script failure, output is displayed in the Delphix Continuous Data UI and CLI for debugging.

  • Success criteria: The command must exit with an exit code of 0. Any other exit codes indicate a failure.

Examples of RunCommand operations

  • Direct command input:

CODE
remove_dir="$DIRECTORY_TO_REMOVE_ENVIRONMENT_VARIABLE"
if test -d "$remove_dir"; then
    rm -rf "$remove_dir" || exit 1
fi
exit 0
  • Running existing scripts with executable permission:

CODE
/opt/app/oracle/product/10.2.0.5/db_1/dbs/myscript.sh "$ARG_ENVIRONMENT_VARIABLE" "second argument in double quotes" 'third argument in single quotes'

RunBash operation

  • Executes a Bash command in a Unix environment using a bash binary provided by Delphix, unless it's a Linux environment, in which case it uses the system's native bash binary.

  • Follows the same execution and logging criteria as the `RunCommand` operation.

  • Success criteria: The Bash command must exit with an exit code of 0.

Example of RunBash operation

CODE
remove_dir="$DIRECTORY_TO_REMOVE_ENVIRONMENT_VARIABLE"
# Bashisms are allowed here!
if [[ -d "$remove_dir" ]]; then
    rm -rf "$remove_dir" || exit 1
fi
exit 0

Running processes in the background

  • To detach a process from the Delphix Continuous Data Engine, use the `nohup` command and process backgrounding.

Redirect stdout and stderr to ensure the Delphix Continuous Data Engine does not block.

Examples of running background processes

Acceptable examples

CODE
nohup python file.py 1>/dev/null 2>&1 & # both stdout and stderr redirected

Deniable examples

CODE
nohup python file.py & # no redirection
nohup python file.py 2>&1 & # only stderr is redirected
nohup python file.py 1>/dev/null & # only stdout is redirected
nohup python file.py 2>/dev/null & # only stdout is redirected
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.