Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

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.

...

  1. Getting Started and Downloading files
  2. Simple File Selection
  3. More Advanced File Selection
  4. File Transfer

  5. Checking files for completeness
  6. Public / Private Key Authentication

File Selection - Simple Examples

Before starting to transfer files JADE reads the contents of the folder specified using the source_dir parameter.

...

In this article the source directory file list will be filtered so that only specific files are transferred.

File Name Filtering and Recursive File Transfer

In the examples JADE was used to transfer all the files from the directory specified in the source_dir parameter.

...

  • Filter the names of files to be transferred using a regular expression
  • Transfer files from sub-directories recursively

Example

In the profile listed below, two new parameters have been added to the sftp_server_2_local_pass example from above:

...

Code Block
languagebash
titleWindows
jade.cmd -settings="%USERPROFILE%\jade_demo\jade_settings.ini" -profile="sftp_server_2_local_select_recursive"

Behavior

  • JADE will download the test_1.txt from the /rec folder on the server and ignore the test.txt file whose name does not match with the file_spec regular expression.
  • JADE will create a /sd folder in the target a directory if this folder does not already exist.
  • It will the open the /rec/sd sub-folder on the server, create a corresponding folder on the target and download the test_2.txt file to this folder.

Behavior with force_file = true

As mentioned above, the default value for the force_file parameter is true, meaning that even if this parameter is not specified, the JADE engine will throw an error if no match is found.

...

If, however, the force_file = true parameter in the example profile is commented in, JADE will not throw an error.

Zero-Byte Files

The JADE Client can filter files with zero bytes using the zero_byte_transfer parameter.

Example

The test_4.txt file on our test server has zero bytes and can be used to demonstrate the use of the zero_byte_transfer parameter.

...

Code Block
languagebash
jade.cmd -settings="%USERPROFILE%\jade_demo\jade_settings.ini" -profile="sftp_server_2_local_zero_byte"

Behavior

  • 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 zero_byte_transfer = no 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$) 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