Versions Compared

Key

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

...

This is the first in a series of articles describing how to get started with using the YADE Client via its Command Line Interface and configuring simple file management tasks.

...

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

...

  • The Fragments elements cover the protocol-specific parts of the configuration - in the current configuration these are that the protocol that is to be used, and the connection and authentication. 
    • Note that a file transfer operation usually requires two Fragments - one for the source part of the transfer and one for the target. However a target fragment is not required here as the the target is the local file system.
    • Any number of Fragments can be predefined within a configuration and specified as required using their name attribute - in the example configuration this is ftp_demo_sos-berlln. This predefinition of Fragments allows their reuse and keeps the configuration well structured.
    • Note that it is not necessary to specify a port here as JADE YADE will automatically use the required value of 21 for FTP operations unless specified otherwise.
  • The Profile elements contain the parameters that are specific to the current operation
    • the Operation to be carried out is copy,
    • the ftp_demo_sos-berlin Fragment that is to be used for the source part of the operation,
    • the  files that are to be transferred:
      •  all files defined using the .* FileSpec
    • the directory in which the files to be transferred is looked for:
      • defined using  / file path,
    • the directory that files are to be transferred to: ${USERPROFILE}\jade_demo\a
      (on a Linux system the equivalent location would be ${HOME}/jade_demo/a ).
  • The ref attribute in the FTPFragmentRef element is used to specify the Fragment to be used - in this case for the source part of the operation.

...

The structure of the configuration is described in more detail in the JADE the YADE User Manual - Configuring and Running File Transfers article and its child articles.

...

Code Block
titleSimple file transfer configuration in XML format
collapsetrue
<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jadeyade/JADEYADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <FTPFragment name="ftp_demo_sos-berlin">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
        </BasicConnection>
        <BasicAuthentication>
          <Account><![CDATA[demo]]></Account>
          <Password><![CDATA[demo]]></Password>
        </BasicAuthentication>
      </FTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="ftp_server_2_local">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <FTPFragmentRef ref="ftp_demo_sos-berlin" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*]]></FileSpec>
                  <Directory><![CDATA[./]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

...

The simple configuration described above is started from the command line or in a batch file on Windows systems using one of the following calls, where sos-berlin_demo_2_local is the name given to the configuration file on saving, depending on the JADE YADE version being used:

Code Block
languagebash
titleRunning the file transfer settings.ini configuration in Windows format (JADE YADE 1.10 and earlier)
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local.ini" -profile="ftp_server_2_local_pass"
Code Block
languagebash
titleRunning the file transfer XML configuration in Windows format (JADE YADE 1.11 and later)
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local.xml" -profile="ftp_server_2_local_pass"

On Unix systems the profile is called 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 Unix format (JADE YADE 1.10 and earlier)
./jade.sh -settings="${HOME}/jade_demo/sos-berlin_demo_2_local.ini" -profile="ftp_server_2_local_pass"
Code Block
languagebash
titleRunning the file transfer XML configuration in Unix format (JADE YADE 1.11 and later)
./jade.sh -settings="${HOME}/jade_demo/sos-berlin_demo_2_local.xml" -profile="ftp_server_2_local_pass"

...

Code Block
languagebash
titleRunning the file transfer settings.ini configuration in Windows format (JADE YADE 1.10 and earlier)
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local.ini" -profile="sftp_server_2_local_pass"
Code Block
languagebash
titleRunning the file transfer XML configuration in Windows format (JADE YADE 1.11 and later)
jade.cmd -settings="%USERPROFILE%\jade_demo\sos-berlin_demo_2_local.xml" -profile="sftp_server_2_local_pass"

...

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

...