• No results found

Starting a new file transfer using the command line

The fteCreateTransfer command creates and starts a file transfer. Using this command you can start a file transfer immediately and schedule a file transfer for a future time and date to repeat a scheduled transfer one or more times and to trigger a file transfer based on certain conditions.

You can run the fteCreateTransfer command from any system that can connect to the WebSphere MQ network and subsequently route to the agent's queue manager.

This command uses the command.properties file to connect to the WebSphere MQ network. If the command.properties file does not contain property

information, a bindings mode connection is made to the default queue manager on the local system. If the command.properties file does not exist, an error is generated.

You can specify multiple source files for a file transfer, but you can specify only one destination. The destination list is not supported, which means transferring one file to multiple destinations.

Example 5-2 shows the fteCreateTransfer command syntax.

Example 5-2 The fteCreateTransfer command syntax

fteCreateTransfer [-p ConfigurationOptions] -sa AgentName [-sm QueueManager] -da AgentName

[-dm QueueManager] [-td TransferDefinitionFile] | ([-df File] | [-dd Directory] |

[-ds SequentialDataset] | [-dp PartitionedDataset]) [-r] [-w] [-t TransferMode] [-cs ChecksumMethod]

[-de <actions>] [-sd <disposition>] [-pr <priority>]

[-md metaData] ([-tr triggerSpec ] [-tl ]) ([-ss startSchedule] [-tb timeBase]

[-oi occurrenceInterval] [-of occurrenceFrequency]

[-oc occurrenceCount] | [-es endSchedule]) -gt [transferTemplateFilePath] [-jn jobName]

SourceFileSpec

The following list provides an explanation of the syntax in Example 5-2:

򐂰 -sa AgentName

Required. The name of the agent that the source file is transferred from.

򐂰 -sm QueueManager

Optional. The name of the queue manager that the source agent is connected to.

򐂰 -da AgentName

Required. The name of the agent that the file is transferred to.

򐂰 -dm QueueManager

Optional. The name of the queue manager that the destination agent is connected to.

Chapter 5. Administering WebSphere MQ File Transfer Edition 101

򐂰 -td TransferDefinitionFile

Optional. The name of the transfer definition XML document that defines one or more source and destination file specifications for the transfer.

򐂰 SourceFileSpec

Required if you specified one of the -df, -dd, -dp, or -ds parameters. If you specify the -td parameter, do not specify source_file_specification.

Source file specifications can include an asterisk as a wildcard that matches zero or more characters. But each file specification must be in one of the following categories:

– File names – Directories

– Sequential data set – Partitioned data set

We introduced basic parameters of the fteCreateTransfer command. If you want to know more information about all of the parameters for

fteCreateTransfer, refer to:

http://publib.boulder.ibm.com/infocenter/wmqfte/v7r0/topic/com.ibm.wmqf te.admin.doc/start_new_transfer_cmd.htm

In this section, we show some examples and explain how to issue this command:

򐂰 Basic example

In this basic example, the file transferPicture.jpg is transferred from WASH.AGENT on Windows to NY.AGENT on Linux and renamed to ny_transferPicture.jpg. Example 5-3 shows the command that we used.

Example 5-3 The basic transfer example

fteCreateTransfer -sa WASH.AGENT -sm WASHQM -da NY.AGENT -dm NYQM -df /home/wmbadmin/ny_transferPicture.jpg C:\transferPicture.jpg

򐂰 Using the options of the priority, overwrite, and non-checksum on file transfer In Example 5-4 the file transferPicture.jpg is transferred from WASHQM’s system to NYQM’s system. The option of priority is set to 5. The destination behavior is overwriting the existing file. The non-checksum parameter is set.

Example 5-4 Advanced transfer example

fteCreateTransfer -sa WASH.AGENT -sm WASHQM -da NY.AGENT -dm NYQM -pr 5 -de overwrite -cs none -df /home/wmbadmin/transferPicture.jpg C:\transferPicture.jpg

򐂰 Transferring from distributed platform to z/OS

In Example 5-5, the file transferText.txt is transferred from WASHQM's system to a data set //'USERID.TRANS.FILE.TXT' on CHICAGOQM's system. Text mode was selected to convert data from ASCII to EBCDIC.

Example 5-5 File transfer from distributed platform to zOS fteCreateTransfer -t text -sa WASH.AGENT -sm WASHQM -da CHICAGO.AGENT -dm MQH1 -ds

"//TRANS.FILE.TXT;RECFM(V,B);BLKSIZE(6144);LRECL(1028);SPACE(5,1)"

C:\transferText.txt

򐂰 Using transfer definition XML files

In Example 5-6, you can use an XML editor that supports schema validation to create the example.xml file. In this transfer definition XML file, you can set different options for each file pair, and you can specify different source and destination locations using the same destination agent.

Example 5-6 Transfer definition file - example.xml

<?xml version="1.0" encoding="UTF-8"?>

<transferSpecifications

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="FileTransfer.xsd">

<item checksumMethod="none" mode="binary">

<source disposition="leave">

<file>c:\sourcefiles\source1.doc</file>

</source>

<destination type="file" exist="error">

<file>c:\destinationfiles\destination1.doc</file>

</destination>

</item>

<item checksumMethod="MD5" mode="text">

<source disposition="delete">

<file>c:\sourcefiles\source2.txt</file>

</source>

<destination type="file" exist="overwrite">

<file encoding="UTF8"

EOL="CRLF">c:\destinationfiles\destination2.txt</file>

</destination>

</item>

<item checksumMethod="none" mode="text">

Chapter 5. Administering WebSphere MQ File Transfer Edition 103 <source recursive="false" disposition="leave">

<file>c:\originfiles\source3.txt</file>

</source>

<destination type="file" exist="overwrite">

<file>c:\targetfiles\destination3.txt</file>

</destination>

</item>

</transferSpecifications>

Save the transfer definition file, example.xml, and use the file for a transfer issued from a command line, as shown in Example 5-7.

Example 5-7 Issuing fteCreateTransfer command with transfer definition file fteCreateTransfer -sa WASH.AGENT -sm WASHQM -da NY.AGENT -dm NYQM -td C:\example.xml

If you submit the fteCreateTransfer command without the -w parameter, you can get the transfer request ID, as shown in Figure 5-6. The request ID can be used in the fteCancelTransfer command or to identify the transfer in log messages.

Figure 5-6 Submitting the transfer request successfully