jputfile, jtool putfile
jputfile
lets you upload a file to the central RunMyJobs server. You can call it as jputfile
or jtool putfile
.
Note: For installation instructions, see jtool
.
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 | Shows the help. | |
-l <loglevel> |
Sets the log level. | |
-f <logfile> |
Logs to a file instead of stdout and stderr . |
|
-j, -job-context | Gets the environment from the job context. | |
<connfile>
|
A file containing connection details, such as host, port, username, and password. Required when -job-context is not specified. You can generate this file with jsecret -c . |
|
-[no]compression | Allows or disallows compression. | |
-[no]verbose | Shows progress during upload in the job description in job-context . |
|
-[no]convert | Converts a file from --filedata to --network character set. |
|
-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 Setting Environment Variables
The following environment variables are used to retrieve proxy server connection details.
HTTP_PROXY
: The URL of the proxy server. For example:https://proxy.example.com:3128
.PROXY_USER
: The user for the proxy server. This value is ignored ifHTTP_PROXY
is not set.PROXY_PASSWORD
: The password for the proxy user. This value is ignored ifHTTP_PROXY
is not set.NO_PROXY
: Enforces a direct connection.
These environment variables override the settings in the connection file for all tools that connect to the central Redwood server.
Process Server Parameters and Environment Variables
Use the ${<name>}
syntax to specify Process Server parameter values. Note that if you shell interprets ${<val>}
, 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. Make sure the shell does not evaluate the variable. See the examples below.
Examples
Process Definition
This example shows how to upload a file to the RunMyJobs server from a Platform Agent. The value for the file is specified in a parameter.
jputfile -j -s ${file}
The destination path is optional. It defaults to the current process files directory.
This example puts a file in a directory named after the BustWatchDirectory
Process Server parameter or environment variable.
jputfile -j -s ${file} -d ${BustWatchDirectory}
Command Line
Assume that you want to add a file to the output files of job 1234
. The output file will be visible in the Process Monitor, along with any other output files of the process.
$ jputfile ~/etc/prod.conn -s myfile.txt -d /job/1234/myfile.txt
INFO 2023-07-27 16:34:48,663 CEST [18594-jputfile] jputfile.main - Uploaded myfile.txt to server path api-file-transfer/job/1234/myfile.txt
INFO 2023-07-27 16:34:48,663 CEST [18594-jputfile] jputfile.main - HTTP/1.1 200 OK
This example uses the verbose
parameter.
$ jputfile ~/etc/prod.conn -verbose -s myfile.txt -d /job/1234/myfile.txt
INFO 2023-07-27 06:07:45,613 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 0 KB)
INFO 2023-07-27 06:07:45,614 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 256 KB)
INFO 2023-07-27 06:07:45,616 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 512 KB)
INFO 2023-07-27 06:07:45,619 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 1024 KB)
INFO 2023-07-27 06:07:45,625 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 2048 KB)
INFO 2023-07-27 06:07:45,637 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 4096 KB)
INFO 2023-07-27 06:07:45,661 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 8192 KB)
INFO 2023-07-27 06:07:45,709 CEST [18692-jputfile] jputfile.main - myfile.txt (HMAC 16 MB)
INFO 2023-07-27 06:07:45,778 CEST [18692-jputfile] jputfile.main - myfile.txt (0%, 0 MB / 25 MB)
INFO 2023-07-27 06:07:45,912 CEST [18692-jputfile] jputfile.main - myfile.txt (10%, 2 MB / 25 MB)
INFO 2023-07-27 06:07:45,044 CEST [18692-jputfile] jputfile.main - myfile.txt (20%, 5 MB / 25 MB)
INFO 2023-07-27 06:07:45,155 CEST [18692-jputfile] jputfile.main - myfile.txt (30%, 7 MB / 25 MB)
INFO 2023-07-27 06:07:45,261 CEST [18692-jputfile] jputfile.main - myfile.txt (40%, 10 MB / 25 MB)
INFO 2023-07-27 06:07:45,376 CEST [18692-jputfile] jputfile.main - myfile.txt (50%, 13 MB / 25 MB)
INFO 2023-07-27 06:07:45,480 CEST [18692-jputfile] jputfile.main - myfile.txt (60%, 15 MB / 25 MB)
INFO 2023-07-27 06:07:45,572 CEST [18692-jputfile] jputfile.main - myfile.txt (70%, 18 MB / 25 MB)
INFO 2023-07-27 06:07:45,690 CEST [18692-jputfile] jputfile.main - myfile.txt (80%, 20 MB / 25 MB)
INFO 2023-07-27 06:07:45,819 CEST [18692-jputfile] jputfile.main - myfile.txt (90%, 23 MB / 25 MB)
INFO 2023-07-27 06:07:45,937 CEST [18692-jputfile] jputfile.main - myfile.txt (100%, 25 MB)
INFO 2023-07-27 06:07:45,950 CEST [18692-jputfile] jputfile.main - Uploaded myfile.txt to server path api-file-transfer/job/1234/myfile.txt
INFO 2023-07-27 06:07:45,950 CEST [18692-jputfile] jputfile.main - HTTP/1.1 200 OK