You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Scope

Examples

All examples are used for JADE Configuration XSD schema http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd

Getting Started

<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <FTPFragment name="ftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[21]]></Port>
        </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_test" />
            </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>

 

<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="sftp_server_2_local_pass">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </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>

Simple File Selection

<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="sftp_server_2_local_select_recursive">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[/rec]]></Directory>
                  <Recursive><![CDATA[true]]></Recursive>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

 

<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <SFTPFragment name="sftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="sftp_server_2_local_zero_byte">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
              <Directives>
                <TransferZeroByteFiles><![CDATA[relaxed]]></TransferZeroByteFiles>
              </Directives>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
  </Profiles>
</Configurations>

 

Simple File Transfer Operations with multiple Profiles

<?xml version="1.0" encoding="utf-8"?>
<Configurations xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/schema/jade/JADE_configuration_v1.0.work.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Fragments>
    <ProtocolFragments>
      <FTPFragment name="ftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[21]]></Port>
        </BasicConnection>
        <BasicAuthentication>
          <Account><![CDATA[demo]]></Account>
          <Password><![CDATA[demo]]></Password>
        </BasicAuthentication>
      </FTPFragment>
      <SFTPFragment name="sftp_test">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPassword>
            <Password><![CDATA[demo]]></Password>
          </AuthenticationMethodPassword>
        </SSHAuthentication>
      </SFTPFragment>
      <SFTPFragment name="sftp_test_key">
        <BasicConnection>
          <Hostname><![CDATA[test.sos-berlin.com]]></Hostname>
          <Port><![CDATA[22]]></Port>
        </BasicConnection>
        <SSHAuthentication>
          <Account><![CDATA[demo]]></Account>
          <AuthenticationMethodPublickey>
            <AuthenticationFile><![CDATA[${USERPROFILE}\jade_demo\demo_id_rsa]]></AuthenticationFile>
          </AuthenticationMethodPublickey>
        </SSHAuthentication>
      </SFTPFragment>
    </ProtocolFragments>
  </Fragments>
  <Profiles>
    <Profile profile_id="ftp_server_2_local">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <FTPFragmentRef ref="ftp_test" />
            </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>
    <Profile profile_id="sftp_server_2_local_pass">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </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>
    <Profile profile_id="sftp_server_2_local_select_recursive">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[/rec]]></Directory>
                  <Recursive><![CDATA[true]]></Recursive>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_zero_byte">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
              <Directives>
                <TransferZeroByteFiles><![CDATA[relaxed]]></TransferZeroByteFiles>
              </Directives>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_poll_minfiles">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
              <Polling>
                <PollInterval><![CDATA[20]]></PollInterval>
                <PollTimeout><![CDATA[1]]></PollTimeout>
                <MinFiles><![CDATA[3]]></MinFiles>
                <KeepConnection><![CDATA[true]]></KeepConnection>
              </Polling>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="replace_local_datestamp">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget>
                <Rename>
                  <ReplaceWhat><![CDATA[^(test)(_)[0-9]\.txt]]></ReplaceWhat>
                  <ReplaceWith><![CDATA[file_;[date:yyyy-MM-dd]_]]></ReplaceWith>
                </Rename>
              </LocalTarget>
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_cumulate">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_.\.txt$]]></FileSpec>
                  <Directory><![CDATA[/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <CumulateFiles>
                <CumulativeFileSeparator><![CDATA[--- File: %{SourceFileName} ---]]></CumulativeFileSeparator>
                <CumulativeFilename><![CDATA[text-files.txt]]></CumulativeFilename>
                <CumulativeFileDelete><![CDATA[true]]></CumulativeFileDelete>
              </CumulateFiles>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="local_2_local_create_md5">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
            <TargetFileOptions>
              <CreateIntegrityHashFile><![CDATA[true]]></CreateIntegrityHashFile>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="local_2_local_check_md5">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_[0-9]\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b\checked]]></Directory>
            <TargetFileOptions>
              <CheckIntegrityHash />
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_atomic">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_large_1\.txt$]]></FileSpec>
                  <Directory><![CDATA[/large/]]></Directory>
                </FileSpecSelection>
              </Selection>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
            <TargetFileOptions>
              <Atomicity>
                <AtomicPrefix><![CDATA[~]]></AtomicPrefix>
                <AtomicSuffix><![CDATA[~]]></AtomicSuffix>
              </Atomicity>
            </TargetFileOptions>
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="local_2_local_check_steady_state">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <LocalSource />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test_large_1\.txt$]]></FileSpec>
                  <Directory><![CDATA[${USERPROFILE}\jade_demo\a]]></Directory>
                </FileSpecSelection>
              </Selection>
              <CheckSteadyState>
                <CheckSteadyStateInterval><![CDATA[2]]></CheckSteadyStateInterval>
                <CheckSteadyStateCount><![CDATA[10]]></CheckSteadyStateCount>
              </CheckSteadyState>
            </SourceFileOptions>
          </CopySource>
          <CopyTarget>
            <CopyTargetFragmentRef>
              <LocalTarget />
            </CopyTargetFragmentRef>
            <Directory><![CDATA[${USERPROFILE}\jade_demo\b]]></Directory>
            <TargetFileOptions />
          </CopyTarget>
        </Copy>
      </Operation>
    </Profile>
    <Profile profile_id="sftp_server_2_local_key">
      <Operation>
        <Copy>
          <CopySource>
            <CopySourceFragmentRef>
              <SFTPFragmentRef ref="sftp_test_key" />
            </CopySourceFragmentRef>
            <SourceFileOptions>
              <Selection>
                <FileSpecSelection>
                  <FileSpec><![CDATA[^test\.txt$]]></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>

 

 

  • No labels