Versions Compared

Key

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

...

This is the second in a series of articles and describes how to perform simple file selection with the YADE Client via its Command Line Interface.

...

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

...

Code Block
titleThe 'ftp_server_2_local_select_recursive' Profile 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_select_recursive">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <FTPFragmentRef ref="ftp_demo_sos-berlin" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[./rec]]></Directory>
                  <Recursive>true</Recursive>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

...

If, however, the DisableErrorOnNoFilesFound element is set to true, JADE YADE will not throw an error.

Note:

  • The meaning of the values true and false for the DisableErrorOnNoFilesFound element are the opposite to the meaning for the element's settings.ini file predecessor, force_files.

Zero-Byte Files

The JADE YADE Client can handle files with zero bytes in a number of ways, depending on the setting used for the TransferZeroByteFiles parameter, which is specified as a child of the Directives element.

...

Code Block
titleThe 'ftp_server_2_local_zero_byte' Profile 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_zero_byte">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <FTPFragmentRef ref="ftp_demo_sos-berlin" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[.*]]></FileSpec>
                  <Directory><![CDATA[./]]></Directory>
                </FileSpecSelection>
              </Selection>
              <Directives>
                <DisableErrorOnNoFilesFound>true</DisableErrorOnNoFilesFound>
                <TransferZeroByteFiles><![CDATA[false]]></TransferZeroByteFiles>
              </Directives>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

...

Code Block
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_select.ini" -profile="ftp_server_2_local_zero_byte"
Code Block
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_select.xml" -profile="ftp_server_2_local_zero_byte"

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

Code Block
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_select.ini" -profile="ftp_server_2_local_zero_byte"
Code Block
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_select.xml" -profile="ftp_server_2_local_zero_byte"

...