File Transfer Profiles
A file transfer profile is a mechanism for pre-configuring different
types of file transfers. Both the mainframe clients (scp2
,
sftp2
) and the server use the same profile mechanism. There are
two types of profiles: named profiles and filename-matched profiles.
Named profiles can be used with the file transfer advice string parameter
P
. A named profile provides the default values for different
advice string parameters. Those default values can be overwritten with
advice string parameters.
The filename-matched profiles can be used for configuring advice string
default values when transferring files whose names match a certain
regular expression. Again, those default values can be overwritten with
advice string parameters.
File transfer profiles for SSH Tectia Server for IBM z/OS can be set in the
/etc/ssh2/ssh_ftadv_config
file globally for all users and in
the $HOME/.ssh2/ssh_ftadv_config
file for each user separately.
The syntax of the profile is:
%NAME|REGEXP ADVSTRING
Each profile starts with a profile name or an egrep
style of
regular expression followed by one or more white spaces and the advice
string. The profile name must start with the percent (%
)
character. The regular expression must not start with the %
character. If the %
character needs to be the first character in
the regular expression, it must be escaped with a backslash (\
).
Note that in order to get the regular expression escape character,
backslash, into a regular expression, it must be escaped by using
\\
.
The profile name and regular expression must start from the beginning of
the line. There must not be any white space in front of the name or
regular expression.
An advice string is a comma-separated list of name-value pairs of type
name=value
. There may be white spaces in the advice string. It
can span over multiple lines. There must be at least one white space
character in the beginning of a spanned advice string line. An advice
string must not contain the file transfer advisor marker /ftadv:/
or a filename.
Profiles with %NAME
can be used with the advice string
P=NAME
. Profiles with REGEXP
are used only for matching
filenames. The first REGEXP
that matches a filename is used.
Comments can be added to the file with a hash (#
) character.
Everything on the line after #
is ignored.
Example File Transfer Profiles
The following examples show file transfer profiles for various situations.
Example 1
The following profile converts text files from Unix to MVS. ASCII is
converted to EBCDIC. This profile is only used if the advice string
contains the parameter P=UNIX
.
%UNIX X=text,
F=line,
C=iso8859-1,
D=ibm-1047
|
Example 2
The next profile converts text files from Windows to MVS. ASCII is
converted to EBCDIC. The line delimiter is converted from the Windows
style to the MVS style. This profile is only used if the advice string
contains the parameter P=WIN
.
%WIN X=text,
F=line,
C=iso8859-1,
D=ibm-1047,
I=dos,
J=mvs
|
Example 3
The following profile can be used when transferring text files from
MVS to another MVS. This profile is only used if the advice string
contains the parameter P=ZOS
.
Example 4
This profile can be used when transferring text files between the Unix
and MVS environments. All datasets created on the MVS side have fixed
blocked lines of 80 characters per line. Again, to use this profile,
P=FB80
needs to be added to the advice string.
%FB80 X=text,
F=line,
C=iso8859-1,
D=ibm-1047,
O=fb,
R=80
|
Example 5
The following profile creates record format datasets with maximum record
length of 1024 bytes. The advice string P=REC
is needed.
Example 6
The following profile can be used when transferring binary files.
Example 7
This next profile is used whenever a dataset name contains the string
TXT
, txt
, TEXT
or text
in it.
//.*(TXT|txt|TEXT|text).*$
X=text,
F=line,
C=iso8859-1,
D=ibm-1047
|
Example 8
The following profile matches files that have the extension .txt
,
.TXT
, .c
, .C
, .h
, .H
,
.log
, .LOG
, .conf
or .CONF
. Codeset
conversion from ASCII to EBCDIC is performed.
.*\\.(txt|TXT|c|C|h|H|log|LOG|conf|CONF)$
X=text,
F=line,
C=iso8859-1,
D=ibm-1047
|
Example 9
The following profile matches binary files with extensions
.gz
, .Z
, .tar
and .bin
.
.*\\.(gz|Z|tar|bin)$
X=bin,
F=stream
|
Example 10
This profile matches all files and dataset names. Data is transferred
in text format and codeset conversion from ASCII to EBCDIC is
performed.
.*$ X=text,
F=line,
C=iso8859-1,
D=ibm-1047
|
Example 11
This profile specifies that record truncation is allowed. Data is
transferred in text format and codeset conversion from ASCII to EBCDIC is
performed.
.*$ X=text,
F=line,
U=yes,
C=iso8859-1,
D=ibm-1047
|
Note: With truncation, data loss may occur.
Enabling Example File Transfer Profiles
File transfer profiles are not enabled by default. File transfer profiles
can be enabled by copying the example profile file
/etc/ssh2/ssh_ftadv_config.example
to
/etc/ssh2/ssh_ftadv_config
(globally for all
users) or $HOME/.ssh2/ssh_ftadv_config
(for a specific user).
> cp /etc/ssh2/ssh_ftadv_config.example /etc/ssh2/ssh_ftadv_config