jputfile, jtool putfile
A platform agent tool used to upload a file to the central Redwood Server. You can call it as jputfile
or jtool putfile
Syntax
jputfile [-h|-?|-help] [-l <loglevel>] [-f <logfile>] {-j|-job-context|<connfile>} [-[no]compression]
[-[no]verbose] -s|-source <file> [-d|-destination <path>]
Argument | Description | |
---|---|---|
-h, -?, -help | Show usage and exit. | |
-l <loglevel> | Set the logging level. Defaults to info | |
-f <logfile> | Log to file instead of stdout/stderr. Defaults to stderr | |
-j, -job-context | Run the command in job-context | |
<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 . | |
-[no]compression | Whether to allow or disallow compression | |
-[no]verbose | Show progress during upload (in job description in job context) | |
-[no]convert | -noconvert | Convert file from --filedata to --network characterset |
-s | -source <file> | |
-d | -destination <path> |
TLS Arguments
Argument | Environment Variable | Description | |
---|---|---|---|
-tlsv1_3, -tls13 | JCS_SSL_METHOD=tlsv1_3 | Use TLS v1.3 secured connection. | |
-tlsv1_2, -tls12 | JCS_SSL_METHOD=tlsv1_2 | Use TLS v1.2 secured connection. | |
-tlsv1_1, -tls11 | JCS_SSL_METHOD=tlsv1_1 | Use TLS v1.1 or better secured connection. | |
-tlsv1, -tls | JCS_SSL_METHOD=tlsv1 | Use TLS v1.0 or better secured connection (default). | |
-sslv3, -ssl | JCS_SSL_METHOD=sslv3 | Use SSL v3 or better secured connection. | |
-cipherlist <text> | JCS_SSL_CIPHERLIST | Set list of available ciphers. | |
-passphrase <text> | JCS_SSL_PASSPHRASE | Set passphrase for private key. | |
-key <file> | JCS_SSL_KEYPATH | Set private key. | |
-cert <file> | JCS_SSL_CERTIFICATE_PATH | Set public certificate. | |
-ca `<file | path>` | JCS_SSL_TRUSTED_CERTIFICATE_FILE | Trusted CA certificates path or file. |
-[no]verify | JCS_SSL_VERIFY_CERT | (Do not) verify peer (server or client) certificate. | |
-verify-names <namelist> | JCS_SSL_VERIFY_SERVER_NAMES , JCS_SSL_VERIFY_CLIENT_NAMES | Verify 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 ifHTTP_PROXY
is not setPROXY_PASSWORD
- The password for the proxy user, ignored ifHTTP_PROXY
is not setNO_PROXY
- Enforce a direct connection
note
These environment variables override the settings in the connection file.
Process Server Parameters and Environment Variables
You use the ${<name>}
syntax to specify process server parameter values; note that if you shell interprets ${<val>}
then you will have to escape the expression according to your shell. The special ${LISTALL}
variable contains a list of all environment variable and process server parameters. Any process server parameter that has remote
set to true
can be accessed in this way.
This can be used outside of job-context
, however, only environment variables are available.
note
jputfile
expects a correctly escaped [environment] variable name for your shell, you must ensure the shell does not evaluate the variable. See examples are available below.
Example
Process Definition
A definition to upload a file to the central Redwood Server from a platform agent, the value for file is specified in a parameter:
jputfile -j -s ${file}
The destination path is optional, defaulting to the current process files directory.
Put the file in the directory named after the BustWatchDirectory
process server parameter or environment variable.
jputfile -j -s ${file} -d ${BustWatchDirectory}
Command Line
You want to add a file to the output files of job 1234
; the output file will be visible in the Processes monitor with any other output files of the process.
$ jputfile ~/etc/prod.conn -s myfile.txt -d /job/1234/myfile.txt
INFO 2023-10-02 16:34:48,663 CEST [18594-jputfile] jputfile.main - Uploaded myfile.txt to server path api-file-transfer/job/1234/myfile.txt
INFO 2023-10-02 16:34:48,663 CEST [18594-jputfile] jputfile.main - HTTP/1.1 200 OK
Using the verbose
parameter
$ jputfile ~/etc/prod.conn -verbose -s myfile.txt -d /job/1234/myfile.txt
INFO 2023-10-02 06:07:45,613 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 0 KB)
INFO 2023-10-02 06:07:45,614 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 256 KB)
INFO 2023-10-02 06:07:45,616 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 512 KB)
INFO 2023-10-02 06:07:45,619 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 1024 KB)
INFO 2023-10-02 06:07:45,625 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 2048 KB)
INFO 2023-10-02 06:07:45,637 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 4096 KB)
INFO 2023-10-02 06:07:45,661 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 8192 KB)
INFO 2023-10-02 06:07:45,709 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 16 MB)
INFO 2023-10-02 06:07:45,778 CEST [18692-jputfile] jputfile.main - myfile.txt (0%, 0 MB / 25 MB)
INFO 2023-10-02 06:07:45,912 CEST [18692-jputfile] jputfile.main - myfile.txt (10%, 2 MB / 25 MB)
INFO 2023-10-02 06:07:45,044 CEST [18692-jputfile] jputfile.main - myfile.txt (20%, 5 MB / 25 MB)
INFO 2023-10-02 06:07:45,155 CEST [18692-jputfile] jputfile.main - myfile.txt (30%, 7 MB / 25 MB)
INFO 2023-10-02 06:07:45,261 CEST [18692-jputfile] jputfile.main - myfile.txt (40%, 10 MB / 25 MB)
INFO 2023-10-02 06:07:45,376 CEST [18692-jputfile] jputfile.main - myfile.txt (50%, 13 MB / 25 MB)
INFO 2023-10-02 06:07:45,480 CEST [18692-jputfile] jputfile.main - myfile.txt (60%, 15 MB / 25 MB)
INFO 2023-10-02 06:07:45,572 CEST [18692-jputfile] jputfile.main - myfile.txt (70%, 18 MB / 25 MB)
INFO 2023-10-02 06:07:45,690 CEST [18692-jputfile] jputfile.main - myfile.txt (80%, 20 MB / 25 MB)
INFO 2023-10-02 06:07:45,819 CEST [18692-jputfile] jputfile.main - myfile.txt (90%, 23 MB / 25 MB)
INFO 2023-10-02 06:07:45,937 CEST [18692-jputfile] jputfile.main - myfile.txt (100%, 25 MB)
INFO 2023-10-02 06:07:45,950 CEST [18692-jputfile] jputfile.main - Uploaded myfile.txt to server path api-file-transfer/job/1234/myfile.txt
INFO 2023-10-02 06:07:45,950 CEST [18692-jputfile] jputfile.main - HTTP/1.1 200 OK