...
This is the second in a series of articles describing how to get started with using the the JADE Client via its Command Line Interface.
Articles The articles in this series are:
- Getting Started and Downloading files
- Simple File Selection
- More Advanced File Selection
- Checking files for completeness
- Public / Private Key Authentication
...
In the examples JADE was used to transfer all the files from the directory specified in the source_dir parameter, which is the default setting.
However, the following profile shows how JADE can be used to:
...
In the profile listed below, two new parameters have been added to the sftp_server_2_local_pass example from above: profile presented in the previous article
file_spec defines the regular expression used to filter file names
- recursive specifies whether the transfer should be carried out recursively (the default value is false)
...
Code Block | ||
---|---|---|
| ||
[sftp_server_2_local_select_recursive]
;;
operation = copy
file_spec = ^test_.\.txt$
;;
recursive = true
;;force_files = false
;;
source_host = test.sos-berlin.com
source_protocol = sftp
source_ssh_auth_method = password
source_port = 22
source_user = demo
source_password = demo
source_dir = /rec
;;
target_host = localhost
target_protocol = local
target_dir = ${USERPROFILE}\jade_demo\a |
...
Code Block | ||
---|---|---|
| ||
[sftp_server_2_local_zero_byte]
;;
operation = copy
file_spec = ^test_[0-9]\.txt$
;;file_spec = ^test_[4]\.txt$
;;
;;zero_byte_transfer = no
zero_byte_transfer = relaxed
;;zero_byte_transfer = strict
;;
source_host = test.sos-berlin.com
source_protocol = sftp
source_ssh_auth_method = password
source_port = 22
source_user = demo
source_password = demo
source_dir = /
;;
target_host = localhost
target_protocol = local
target_dir = ${USERPROFILE}\jade_demo\a |
...
- With the zero_byte_transfer parameter set to relaxed (i.e. with the file_spec and zero_byte_transfer parameters set as listed above) the test_4.txt zero byte file will not be downloaded.
- A setting of Changing the zero_byte_transfer = no setting to no by commenting in/out the appropriate line in the profile and rerunning the example will:
- cause the the test_4.txt file to be ignored as with the relaxed setting and
- cause an error to be raised if no files with more than zero bytes are found - i.e. if no files are to be transferred.
This can be demonstrated by activating the alternative file_spec regex (^test_[4]\.txt$) setting which will only match for the zero byte file.
- A setting of zero_byte_transfer = strict will cause an error to be raised if any zero byte files are matched