Redwood Documentation

Product Documentation

 

›Command Line Tools

RunMyJobsPlatform Agents

External Platforms

  • Connecting Redwood Server to External Platforms

Credentials

  • Storing Credentials
  • Credential Protocols

Platform Process Servers

  • On-site Platform Process Servers
  • Cloud Platform Agents
  • Using the Wizard to Create Process Servers
  • Configuring Platform Agents
  • Spool Host Agents
  • The Environment of Platform Agent OS Processes
  • Processing Platform Processes
  • Process Server Services
  • Configuring Agentless Process Servers
  • Automatically Updating Platform Agents
  • Enabling TLS
  • Creating Monitoring Checks
  • Configuring Load Balancing on Platform Agents
  • Platform Agent Registry Entries
  • Monitoring Servers with Platform Process Servers

UNIX Agents

  • UNIX Process Servers
  • UNIX Process Server Configuration Data
  • File Events on UNIX
  • Creating UNIX Process Servers (Advanced)
  • Choosing a User Switching Security Mode
  • Controlling Unix Platform Agents
  • Uninstalling Redwood Server Platform Agents from UNIX

Windows Agents

  • Creating a Microsoft Windows Process Server
  • File Events on Microsoft Windows Process Servers
  • Configuration of a Microsoft Windows Process Server
  • Managed Services
  • Configuring Platform Agents on Microsoft Windows
  • Automating Windows tasks that require a desktop window
  • Uninstalling Redwood Server from Microsoft Windows

Agent Definition Types

  • Using the BASH Definition Type
  • Using the KSH Definition Type
  • Using the CSH Definition Type
  • Using the Perl Definition Type
  • Using the Python Definition Type
  • Using the PowerShell Definition Type
  • Using the Visual Basic Script Definition Type
  • Using the CMD Definition Type
  • Using the R Process Definition Type
  • Using the DCL Definition Type
  • Using Platform Definition Types
  • Using the OS Native Definition Type
  • Microsoft Windows Definition Types
  • Using the SQLPLUS Definition Type
  • Using the FTP Definition Type
  • Using the Groovy Definition Type

Command Line Tools

  • Command Line System Tools
  • jtool
  • jcat
  • jdescription
  • jevent
  • jecho
  • jftp
  • JFTP Return Codes
  • jgetcredential
  • jgetfile
  • jgetpar
  • jjoin
  • jlink
  • jlog
  • jmail
  • jmessage
  • jmonitor
  • jputfile
  • jregister
  • jrfc
  • jscp
  • jtool screenshot
  • jscript
  • jsecret
  • jsleep
  • jsplit
  • api-tool.jar

OpenVMS Process Servers

  • Creating HP OpenVMS Process Servers
  • Installing the Platform Agent on HP OpenVMS
  • Configuring HP OpenVMS Process Servers
  • File Events on HP OpenVMS
  • HP OpenVMS Definition Types

AS/400 Connector

  • IBM AS/400 Connector Architecture
  • Setting up the IBM AS/400 Connector
  • Creating an IBM AS/400 Process Server
  • Files on AS/400 Raise Events
  • Using the AS/400 Definition Type
  • Redwood Server OS Support
  • IBM z/OS Definition Types
  • Using the JCL_FTP Definition Type
  • IBM z/OS System Tools

Reference

  • Balancing the Load
  • Credential Protocols
← jtool screenshotjsecret →

jscript, jtool script

A platform agent tool used to execute RedwoodScript commands from the command line. This tool uses a connection file, and operation is synchronous: the script is executed the moment it receives an execute command.

Commands are always read from standard input. If standard input is a terminal and the silent option has not been set, a prompt will be shown. If standard input is a (redirected) file, pipe or stream, no prompt is shown. If you use the -s option, the only output given will be that sent by the server. This consists of user-created output via jcsOut and jcsErr as well as errors thrown by the interpreter (which go to stderr).

Syntax

jscript  [-h|-?|-help] [-l <loglevel>] [-f <logfile>] -j|-job-context|<connfile>
         [-i|-interactive] [-s|-silent] [-m|-message-server]
         [-t|-timeout <seconds>] [-protect]
ArgumentDescription
-h, -?, -helpShow this help and exit.
-l <loglevel>Set the logging level.
-f <logfile>Log to file instead of stdout/stderr.
-j, -job-contextObtain environment from job-context.
-iInteractive, execution will not stop on successful execution of the first command.
-sSilent, suppress prompts and feedback (but not error messages).
-t, -timeoutTimeout in seconds that jscript waits; default is set to 600 seconds (10 minutes)
<connfile>A file containing connection details, like host, port, username, and password. Required when -job-context is not specified. You generate this file with jsecret -c.
TLS Arguments

The arguments require the -protect argument.

ArgumentEnvironment VariableDescription
-tlsv1_3, -tls13JCS_SSL_METHOD=tlsv1_3Use TLS v1.3 secured connection.
-tlsv1_2, -tls12JCS_SSL_METHOD=tlsv1_2Use TLS v1.2 secured connection.
-tlsv1_1, -tls11JCS_SSL_METHOD=tlsv1_1Use TLS v1.1 or better secured connection.
-tlsv1, -tlsJCS_SSL_METHOD=tlsv1Use TLS v1.0 or better secured connection (default).
-sslv3, -sslJCS_SSL_METHOD=sslv3Use SSL v3 or better secured connection.
-cipherlist <text>JCS_SSL_CIPHERLISTSet list of available ciphers.
-passphrase <text>JCS_SSL_PASSPHRASESet passphrase for private key.
-key <file>JCS_SSL_KEYPATHSet private key.
-cert <file>JCS_SSL_CERTIFICATE_PATHSet public certificate.
-ca <file_path>JCS_SSL_TRUSTED_CERTIFICATE_FILETrusted CA certificates path or file.
-[no]verifyJCS_SSL_VERIFY_CERT(Do not) verify peer (server or client) certificate.
-verify-names <namelist>JCS_SSL_VERIFY_SERVER_NAMES, JCS_SSL_VERIFY_CLIENT_NAMESVerify peer (server or client) certificate hostname against list.
Proxy Settings

The following environment variables are used to retrieve proxy server connection details:

  • HTTP_PROXY - The URL to the proxy server, https://proxy.example.com:3128
  • PROXY_USER - The user for the proxy server, ignored if HTTP_PROXY is not set
  • PROXY_PASSWORD - The password for the proxy user, ignored if HTTP_PROXY is not set
  • NO_PROXY - Enforce a direct connection
note

These environment variables override the settings in the connection file.

Setting the Return Code

The jcsShell.setReturnCode(int) method is used to set the return code of the script. You throw an exception if you want to terminate processing; the last effective call to jcsShell.setReturnCode() will set the return code.

Buit-in Commands

The following built-in commands are available in jscript:

  • query - Perform an SQL query against the data model:
    • Supports formats xml, csv, and html.
    • Bind parameters are specified using the following syntax bind <position> <dataType> <value>.
  • submit - Submit a process:
    • Parameters are filled using the following syntax parameter <parameter_name> <value>.
    • Optionnally, you can set a timeout and status or final, for any final state; once either is reached jscript stops waiting. Accepts the following syntaxes: wait <milliseconds_to_wait> final or wait <milliseconds_to_wait> status <status>.
Query Example
jscript> query
set format csv
bind 1 BigDecimal 5
bind 2 String '%Test%'
select count(*) from Job where JobId > ? and Description like ?
Submit Example
jscript> submit System_Sleep
parameter MilliSeconds 10000
wait 60000 final

Example

The following shows how we submit a process from a UNIX shell. In this example, the Redwood Server is named pr1.example.com, its port is 50000, and the context is /redwood. Note, that when you enter your password for the connection file, no text is displayed as you type; this improves the security of your password.

$ jsecret -c ../../net/instance/default/example.conn https://pr1.example.com:50000/redwood
Username:jdoe
Password:

$ jscript ../../net/instance/default/example.conn <<EOF
{
  JobDefinition jDefinition = jcsSession.getJobDefinitionByName("System_Info");
  Job process = jDefinition.prepare();
  jcsSession.persist();
}
/
EOF

The jscript program can also read commands from a file as follows:

$ cat script.rws
{
  JobDefinition jDefinition = jcsSession.getJobDefinitionByName("System_Info");
  Job process = jDefinition.prepare();
  jcsSession.persist();
}
/
$ jscript ../../net/instance/default/example.conn < script.rws

If you perform the same but use the terminal to supply input you will see prompts:

$ jscript../../net/instance/default/example.conn
Connected to example
jscript> {
      2>   JobDefinition jDefinition = jcsSession.getJobDefinitionByName("System_Info");
      3>   Job process = jDefinition.prepare();
      4>   jcsSession.persist();
      5> }
      6> /
Result: OK
$

See Also

  • Command Line System Tools
← jtool screenshotjsecret →
  • Syntax
  • Buit-in Commands
  • Example
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |