File Transfers Using Command-Line Applications
In most of these examples, SSH Tectia Client 5.2. is used. Examples can be used also
with other clients if not mentioned otherwise. These examples apply to both
Unix and Windows command-line clients.
Interactive File Transfers Using Command-Line Applications
SSH Tectia Client on Windows and Unix contain two file transfer applications.
-
scpg3
is a secure replacement for remote copy and provides
easy secure interactive and non-interactive file transfers.
-
sftpg3
is a secure replacement for FTP and provides a
user interface for interactive file transfers and a batch mode for
unattended file transfers.
The file transfer formats are the same as described earlier.
Example 1: scpg3
file transfer from Unix file to MVS
partitioned dataset member using default file transfer profile.
$ scpg3 textfile.txt user1@zos:/__USER1.TEST2.PDS/MEMBER1
Example 2: scpg3
file transfer from MVS sequential
dataset to Windows file using a Windows profile.
C:\> scpg3 user1@zos:/ftadv:P=WIN/___USER1.TEST2.PS.FILE c:\temp\my_file.txt
Example 3: scpg3
file transfer of a partitioned dataset
with members to Unix directory and files using the default profile.
$ scpg3 -r user1@zos:/_TEST2.PDS /tmp/pds/
Example 4: File transfers between Unix and z/OS using
sftpg3
(the sput
and sget
commands are available
on SSH Tectia Client 5.2 and later).
$ sftpg3 user1@zos
user1@zos's password:
sftp> sget /_TEST2.PDS/MEMBER1 /tmp/member1
sftp> sget /FTADV:X=BIN/__TEST.PS.FILE1
sftp> sput /tmp/local_file.txt /FTADV:P=FB80/___&SYSUID..SSZ.SAMPLIB/JCL1
|
Example 5: Using the site
command to define additional
dataset parameters (available on SSH Tectia Client 5.2 and later).
Parameters can be entered either one by one, or several parameters can be
delimited by commas or spaces. Both long parameters and abbreviations can be
used. The plain site
command outputs the list of entered parameters.
sftp> site LRECL=80
sftp> site RECFM=FB,VOLUMES=TEST
sftp> site X=TEXT,C=ISO8859-1,D=IBM-1047
sftp> site
Remote site parameters:
O=FB,R=80,VOLUMES=TEST,X=TEXT,C=ISO8859-1,D=IBM-1047
|
Example 6: File transfers using Unix OpenSSH client.
$ sftp user1@zos
Connecting to zos
user1@zos's password:
sftp> get /_TEST2.PDS/MEMBER1 /tmp/member1
sftp> get /FTADV:X=BIN/__TEST.PS.FILE1
sftp> put /tmp/local_file.txt /FTADV:P=FB80/___&SYSUID..SSZ.SAMPLIB/JCL1
|
Unattended File Transfers Using Command-Line Applications
scpg3
commands can be used as Scheduled Tasks on Windows, or as
cron jobs on Unix. With sftpg3
, batch mode can be used. The
syntaxes for scpg3
and sftpg3
are the same as described
before.