Versions Compared

Key

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

Table of Contents

Introduction

This is the third in a series of articles describing how to get started with using the the JADE YADE Client via its Command Line Interface and covers:

  • Polling a Source Directory

...

YADE Tutorials List

...

YADE Client 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
  7. Transfer via a Jump Host / DMZ

...

YADE Background Service

  1. Installation, Configuration and Use

Prerequisites

See the Using the tutorials with the JADE YADE Client Command Line Interface article for guidelines to setting up and running the tutorial examples.

Instructions for installing, configuring and using the XML Editor can be found in the XML Editor series of articles.

Download file

The configuration described in this tutorial can be downloaded and then directly opened in the XML Editor using the following link:

Polling a source directory for a minimum number of files

JADE YADE can poll a source directory at regular intervals until it finds a file name match or until a specified length of time has elapsed. If it finds a file name match with one or more files it will then transfer the matching file(s) and then stop polling.

JADE YADE can also delay transfer until a minimum number of file name matches has been found.

JADE YADE will transfer all those files it has found at the end of the polling interval if the minimum number of matches has not been reached.

Configuration structure

ProtocolFragment

The ftp_demo_sos-berlin ProtocolFragment used in the first tutorial in this series will be reused. 

Profile

The example presented in this tutorial uses a Profile based on the ftp_server_to_local Profile described in the first tutorial in this series.

The new Profile, has been given the profile_id = ftp_server_to_local_poll and the following changes have been made:

FileSpec

The value of the FileSpec element was changed to ^test_.\.txt$. Five files will be found in the transfer source directory.

Polling Elements

The Polling parent element is added as a child of the SourceFileOptions element. In the example profile shown in the XML Editor screenshot below the function of the three polling parameters should be self-explanatory but the following should be noted:

  • PollInterval - is specified in seconds (only integer values)

  • PollTimeout - is specified in minutes (only integer values)

  • MinFiles - optional - can only be used together with PollTimeout

XML Editor Configuration

The Profile Code

The following code boxes can be opened to show the Profile and ProtocolFragments used in this example in XML and in settings.ini formats.

...

Code Block
languagetext
titleThe 'ftp_server_2_local_poll_minfiles' Profile in settings.ini Format
collapsetrue
[protocol_fragment_ftp@ftp_demo_sos-berlin]
protocol                            = ftp

host                                = test.sos-berlin.com
user                                = demo
password                            = demo

[ftp_server_2_local_poll_minfiles]
operation                           = copy

source_include                      = protocol_fragment_ftp@ftp_demo_sos-berlin
file_spec                           = ^test_.\.txt$
source_dir                          = ./
poll_interval                       = 20
poll_timeout                        = 1
poll_minfiles                       = 3

target_protocol                     = local
target_dir                          = ${USERPROFILE}\jade_demo\a

Running the Profile

This profile is called on Windows systems using one of the following commands, depending on the JADE YADE version being used:

Code Block
languagebash
titleRunning the file transfer settings.ini configuration in Windows format (JADE 1.10 and earlier)
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local_poll.ini" -profile="ftp_server_2_local_poll_minfiles"

...

Code Block
languagebash
titleRunning the file transfer XML configuration in Unix format (JADE 1.11 and later)
./jade.sh -settings="${HOME}/jade_demo/sos-berlin_demo_2_local_poll.xml" -profile="ftp_server_2_local_poll_minfiles"

Example behavior with MinFiles less than the number of files found 

  • JADE YADE runs the first polling operation immediately and will transfer all the files found - in this case the 5 test_*.txt files - as more than the minimum number of files has been found. Polling will then be stopped.
  • If no files were to be found then the JADE YADE engine would throw an error as long as DisableErrorOnNoFilesFound = true has not been set.

Example behavior with MinFiles more than the number of files found

Change the MinFiles parameter in the XML Editor to 6, save the configuration and rerun the example.

  • JADE YADE will find the five test_*.txt files when it polls but will not transfer the files as the minimum number of 6 has not been reached.
  • JADE YADE will repeat polling until the time set in the PollTimeout parameter (with the example configuration after 1 minute 20 secs) has expired.
  • Note that all the files that have been found will be transferred once the timeout has been reached.

...