Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
h1. Variables in JADE parameters
Variables as Parameter argument from Command line
YADE settings and command line arguments
- YADE accepts parameters from a settings file and from the command line.
YADE example for a settings file
Code Block | ||
---|---|---|
| ||
Code Block | ||
[ftp_server_2_server]
ssh_auth_method=password
source_user=kb
source_password=*****
source_ssh_auth_method=password
source_host=wilma.sos
source_protocol=sftp
source_port=22
target_user=test
target_password=*****
target_host=8of9.sos
target_protocol=ftp
target_port=21
file_spec=^.*\.txt$
operation=copy
|
...
YADE example for mixed usage of settings and command line arguments
- YADE can use the transfer profile from the above jade_settings.ini and
...
- parameters from the CLI command line interface
...
- .
- Command line parameters have precedence. If a parameter value is provided from the CLI, then parameters from jade_settings.ini will be overwritten.
Code Block | ||
---|---|---|
| ||
./jade.sh -settings="jade_settings.ini" -profile="ftp_server_2_server" -local_dir="${source_dir}" -remote_dir="${archive_dir}"
|
Variables in a jade_settings.ini
...
An Example Transfer Profile
A profile definition for Server to Server transfer, from a sftp to a ftp server:
profile
- YADE profiles can use variables that are substituted within settings
YADE example for a settings file with variables
Code Block |
---|
[globals]
sftp.port = 22
ftp.port = 21
|
Code Block |
[ftp_server_2_server] file_spec =^.*\.txt$ operation =copy ssh_auth_method = password source_user = kb source_password = ***** source_ssh_auth_method = password source_host = wilma.sos source_protocol = sftp source_port=22 = ${sftp.port} target_user = test target_password = ***** target_host=8of9.sos target_protocol=ftp target_port=21 file_spec=^.*\.txt$ operation=copy log_filename=$\{TEMP\}/sosftphistory.log |
In this example all files with the file name extension ".txt" should be transfered from the server "wilma" via sftp to the server 8of9 by ftp. the folders are not explicitely specified and therefore the "home" folders of the user are selected.
Profile fragments
To make the profile more reusable and readable it is possible to reuse profiles snipets in the way like this:
Code Block |
---|
[wilma]
user=kb
password=*****
ssh_auth_method=password
host=wilma.sos
protocol=sftp
port=22
[8of9]
user=test
password=*****
host=8of9.sos
protocol=ftp
port=21
[globals]
log_filename=$\{TEMP\}/sosftphistory.log
|
The profiles for wilma and 8of9 are defined only once. They could be used as many time as needed in different transfer profiles. There is a "globals" profile as well.
Define Profiles using the include directive
Now we will specify the transfer profile again:
Code Block |
---|
[ftp_server_2_server]
source_include=wilma
target_include=8of9
operation=copy
file_spec=^.*\.txt$
[ftp_more]
target_include=wilma
source_include=8of9
operation=move
file_spec=^.*\.(txt|pdf|dat)$
source_folder=/outbound/daily
target_folder=/inbound/transfer
|
The "include" parameter will include the named profiles in the order they are defined. In the first example wilma will be included as source and in the second example as target. The "globals" profile is included automatically, no need to specifiy it in an include parameter.
The profiles must be defined in the same settings file.
= 8of9.sos
target_protocol = ftp
target_port = ${ftp.port}
|
YADE example of variables in jade_settings.ini file
- The jade_settings.ini file can use variables in a profile.
- Such variables can be defined in the global profile and subsequent profiles. The globals profile is included automatically by all profiles.
Code Block | ||
---|---|---|
| ||
./jade.sh -settings="jade_settings.ini" -profile="ftp_server_2_server"
|
See also
- For information about the parameters see the YADE Parameter Reference Documentation.
For infos about the parameters see the parameter documentation on jadeParameterReference
.