Chapter 11: FTP Jobs
FTP Jobs :
Using your agent, you can automate File Transfer Protocol (FTP) transfers with an FTP
job. The FTP job can upload data to or download data from an existing FTP server or
another agent running as an FTP server. The FTP job always acts as an FTP client.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.
You can use an FTP job to automate the following:
■ Download ASCII, binary, or EBCDIC (i5/OS only) files from a remote FTP server to
your agent computer.
■ Upload ASCII, binary, or EBCDIC (i5/OS only) files from your agent computer to a
remote FTP server.
Your agent administrator can set up the agent to run as an FTP client, FTP server, or
both.
EBCDIC File Transfers
The EBCDIC transfer type applies to CA WA Agent for i5/OS only.
For the QSYS file system on i5/OS systems, you can only transfer members of FILE
objects.
Note: For more information about FTP restrictions on i5/OS systems, see the IBM
documentation.
FTP Jobs
Wildcard Characters in File Names
You can use wildcards in file names for ASCII, binary, and EBCDIC transfers. The asterisk
(*) is a wildcard for zero or more characters and the question mark (?) is a wildcard for a
single character.
Running the Agent as an FTP Client
If the agent runs as an FTP client, the agent can log in to remote FTP servers and
download files from and upload files to those servers.
The following diagram shows the relationship between an agent running as an FTP
client, the scheduling manager, and an FTP server:
Note: The FTP user ID used to connect to the FTP server must be defined on the
scheduling manager.
When the agent runs as an FTP client only, other FTP clients (such as other agents)
cannot log in to the agent to transfer files. To let other FTP clients log in and transfer
files, the agent administrator needs to set up the agent to run as an FTP server.
FTP Jobs
Chapter 11: FTP Jobs 303
Running the Agent as an FTP Server
The agent supports a built-in FTP server capability. The agent administrator can enable
the agent to act as a generic FTP server in addition to its other roles. This server adheres
to the security rules established for the agent.
If the agent runs as an FTP server, clients can log in to the agent and transfer files.
The following diagram shows the relationship between an agent running as an FTP
server, the scheduling manager, and another agent running as an FTP client:
Note: The FTP user ID used to connect to the agent running as an FTP server must be
defined on that agent and the scheduling manager.
If the agent is configured as an FTP server, the agent can handle ASCII, binary, and
EBCDIC file transfers, wildcard requests, simple GET and PUT requests for single files,
and MGET and MPUT requests for multiple files.
The agent has a secure store of FTP server user IDs and associated passwords. The
ftpusers.txt file, located in the directory where the agent is installed, stores these user
IDs and their corresponding hashed passwords.
The agent running as an FTP server does not support anonymous FTP requests. For audit
purposes, the agent provides a detailed log of all FTP requests.
Note: For more information about enabling the agent to act as a generic FTP server,
contact your agent administrator and see the CA Workload Automation Agent for UNIX,
Linux, or Windows Implementation Guide.
Define an FTP Job
304 User Guide
FTP User IDs and Passwords
All FTP user IDs and passwords must be defined on CA Workload Automation AE by
using the autosys_secure command. When you define an FTP job, you must specify an
FTP user ID using the owner attribute, or use the default owner value. This user ID is
used to connect to the FTP server for the file transfer.
If an agent runs as an FTP server, the FTP user ID and password must also be defined on
that agent.
Note: For more information about the autosys_secure command, see the Reference
Guide. For more information about defining user IDs on the agent, see the CA Workload
Automation Agent for UNIX, Linux, or Windows Implementation Guide.
Define an FTP Job
You can define an FTP job to automate FTP transfers. The output is directed to the spool
file through an FTP server.
Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, Windows,
or i5/OS.
Follow these steps:
1. Insert a job and specify the following attributes in the definition:
job_type: FTP
Specifies that the job type is FTP.
machine
Specifies the name of the machine on which the job runs.
ftp_local_name
Specifies the destination of the file (if downloading) or the source location of
the file (if uploading).
ftp_remote_name
Specifies the source location of the file (if downloading) or the destination of
the file (if uploading).
ftp_server_name
Specifies the DNS name or IP address of a remote server.
Define an FTP Job
Chapter 11: FTP Jobs 305
2. (Optional) Specify optional FTP attributes:
■ ftp_command
■ ftp_compression
■ ftp_local_user
■ ftp_server_port
■ ftp_transfer_direction
■ ftp_transfer_type
■ ftp_use_SSL
■ ftp_user_type
■ job_class
3. (Optional) Specify the following attribute:
owner
Specifies the user ID with the authority to download the file from the remote
FTP server or upload the file to the remote FTP server.
Note: The job runs under the owner of the job. The password associated with
the owner must be defined using autosys_secure.
4. (Optional) Specify common attributes that apply to all job types.
The FTP job is defined.
Notes:
■ Attributes that have a default value automatically apply to the job definitions;
therefore, they are optional. For example, jobs with no specified job type are
defined as command jobs by default. Other optional attributes specify information
that is not required but affects how or when a job runs, such as attributes that
specify scheduling conditions.
■ Some optional attributes are common to all job types but others apply to certain
jobs types only. Optional attributes that apply to all job types are known as
common optional attributes. For more information about common optional
attributes and the values that you can specify for them (including their default
values when applicable), see the Reference Guide.
■ For information about required attributes and job type specific optional attributes,
see the procedure topics that provide instructions for defining jobs.
■ This guide provides instructions for defining jobs interactively. You also create job
definitions in script files and then import them using the jil command or use CA
WCC to define them. For more information about the JIL command and JIL syntax,
see the Reference Guide. For more information about using CA WCC to define the
job, see the CA Workload Control Center Workload Scheduling Guide.
Define an FTP Job
306 User Guide
Example: Download a File from a UNIX Computer to a Windows Computer
The FTP job in this example downloads a file from a UNIX server with IP address
172.16.0.0 and port 21 to a Windows computer.
insert_job: FTPT1A
job_type: FTP
machine: ftpagent
ftp_server_name: 172.16.0.0
ftp_server_port: 21
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: A
ftp_remote_name: /u1/ftpdata/textfile
ftp_local_name: "c:\ftpfiles"
owner: ftpuser@172.16.0.0
Example: Download a Binary File on UNIX
The FTP job in this example uses a binary transfer.
insert_job: FTPBINARY
job_type: FTP
machine: unixagent
ftp_server_name: hpunix
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: B
ftp_remote_name: /u1/qatest/ftpdata/binaryfile
ftp_local_name: /export/home/qatest/ftpdata/transf.bin
owner: test@hpunix
Example: Download a QSYS EBCDIC-encoded File
This example downloads an EBCDIC-encoded file named DATAFILE in the QSYS file
system from an i5/OS system to another i5/OS system. The file names are specified in
the path format.
insert_job: EBCDIC_FILE
job_type: FTP
machine: I5AGENT
ftp_server_name: i5agent
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: E
ftp_remote_name: /QSYS.LIB/DATALIB.LIB/DATAFILE.FILE/DATA.MBR
ftp_local_name: /QSYS.LIB/ESPLIB.LIB/DOWNLOAD.FILE/DATA.MBR
owner: test@i5agent Attributes with Default Values
Chapter 11: FTP Jobs 307
More information:
Insert a Job Definition (see page 88)
Attributes with Default Values
Attributes that have a default value automatically apply to the job definition. Therefore,
you do not have to specify those attributes in the definition. Your agent administrator
can define some default values on the agent in the agentparm.txt file.
If you specify the attribute in a job definition, it overrides the default.
The following FTP job attributes have default values:
ftp_compression
Specifies the data compression level (0-9).
Default:
■ 0 (The data is not compressed.)
■ ftp.data.compression agent parameter. This parameter overrides the default 0
setting.
ftp_transfer_direction
Specifies the file transfer direction.
Default: DOWNLOAD (The job transfers files from the remote server to the agent
computer.)
ftp_transfer_type
Specifies the type of data involved in an FTP transfer (B for binary, A for ASCII, or E
for EBCDIC).
Default: B (The job performs a binary data transfer.)
ftp_use_ssl
Specifies whether to transfer the data with Secure Sockets Layer (SSL)
communication or regular communication.
Default:
■ FALSE (The job uses regular communication.)
■ ftp.client.ssl agent parameter. This parameter overrides the default FALSE
setting.
Attributes with Default Values
308 User Guide
ftp_user_type
Specifies how the value of the owner attribute is passed to the FTP server for
authentication.
Default: Simple (The job passes only the user part of the owner attribute value to
the FTP server for authentication.)
owner
Specifies the FTP user ID that the job runs under.
Default: The user defining the job (The FTP transfer runs under the owner of the
job.)
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.
Example: Perform an ASCII Data Transfer
The ftp_transfer_type and owner attributes in the following job definition override the
default values. The job transfers an ASCII file under the testuser account.
The FTP job in this example downloads an ASCII file named textfile from the remote
UNIX server to the /export/home/ftpfiles/ftpdata/textfile_dn directory on the agent
computer.
insert_job: DOWNLOAD_SINGLE
job_type: FTP
machine: RAGENT
ftp_server_name: hprsupp
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: A
ftp_remote_name: /u1/files/ftpdata/textfile
ftp_local_name: /export/home/ftpfiles/ftpdata/textfile_dn/textfile
owner: testuser@hprsupp Transfer Files Using SSL FTP
Chapter 11: FTP Jobs 309
Transfer Files Using SSL FTP
If the agent FTP server supports SSL FTP and the agent FTP client has SSL FTP configured,
you can securely transfer data using Secure Sockets Layer (SSL) communication.
Follow these steps:
1. Define an FTP job (see page 304).
2. Add the following attribute to the job definition:
ftp_use_ssl
Specifies whether to transfer the data with Secure Sockets Layer (SSL)
communication or regular communication.
3. Run the job.
The files are transferred using the specified communication setting.
Notes:
■ To transfer data using SSL, the FTP server must have SSL FTP enabled and the FTP
client must have SSL configured (SSL FTP can be enabled or disabled).
■ If you do not specify the ftp_use_ssl attribute, the data is transferred using the
default FTP setting (regular FTP or SSL FTP) set on the agent FTP client as follows:
– If the agent FTP client has SSL FTP enabled, all FTP jobs on that agent
automatically use SSL FTP.
Note: If the FTP server does not support SSL FTP, you must set the ftp_use_ssl
attribute to FALSE. Otherwise, the job will fail.
– If the agent FTP client has SSL FTP disabled, all FTP jobs on that agent
automatically use regular FTP.
Transfer Files Using SSL FTP
310 User Guide
Example: Upload a File from a Local Computer to a Remote Windows Server Using SSL
FTP
This example defines a job named FTP_UPLOAD to upload the filename.txt file from the
agent FTP client to the c:\uploaded_files directory on the remote Windows server
named winserver using SSL FTP.
Note:
insert_job:FTP_UPLOAD
job_type: FTP
machine: winagent
owner: user1@winserver
ftp_server_name: winserver
ftp_server_port: 21
ftp_transfer_direction: UPLOAD
ftp_use_SSL: TRUE
ftp_remote_name: "c:\uploaded_files\filename.txt"
ftp_local_name: "d:\files_to_upload\filename.txt" Transfer Files Using SSL FTP
Chapter 11: FTP Jobs 311
Example: Download a File from a Remote UNIX Server That Does Not Support SSL FTP
to a Local Computer That Supports SSL FTP
In this example, the agent runs on a local computer as an FTP client and has SSL FTP
enabled (all FTP jobs on the agent computer run using SSL FTP by default). The remote
UNIX server does not support SSL FTP.
The following FTP job downloads the filename.txt file from the remote UNIX server to
the d:\downloaded_files directory on the local computer. Because the FTP server does
not support SSL FTP, the ftp_use_SSL attribute is set to FALSE so the job does not fail.
insert_job: FTP_DOWNLOAD
job_type: FTP
machine: winagent
owner: user1@hpunix
ftp_server_name: hpunix
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_use_SSL: FALSE
ftp_remote_name: /files_to_download/filename.txt
ftp_local_name: "d:\downloaded_files\filename.txt" Compress Data for FTP
312 User Guide
Compress Data for FTP
When running FTP workload between an FTP client and FTP server that are both run on
the agent software, you can compress the data for the transfer by specifying the
compression level in the job definition.
Note: If the compression level is specified and the FTP server or the FTP client does not
run on the agent, the data will be transferred without compression.
Follow these steps:
1. Define an FTP job (see page 304).
2. Add the following attribute to the job definition:
ftp_compression
Specifies the data compression level. The compression level is a one-digit value
from 0 to 9, where 0 is no data compression and 9 is the best data
compression.
Note: The effectiveness of the compression is dependent upon the data.
Compressing the data may not result in faster transfer times. The overhead of
compressing and uncompressing the data may exceed the time saved from
sending smaller amount of data.
3. Run the job.
The files are transferred using SSL FTP.
Example: Compress a File
The local computer in this example has an agent running as an FTP client. The remote
server has an agent running as an FTP server. Both computers operate on a low
bandwidth network.
The following FTP job downloads a large file named largefile.txt from the remote server
to the FTP client. The computers are on a low bandwidth network, so the data is
compressed at compression level 3.
insert_job: FTPJOB
job_type: FTP
machine: ftpagent
ftp_server_name: aixunix
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_compression: 3
ftp_remote_name: /files_to_download/largefile.txt
ftp_local_name: "c:\downloaded_files\largefile.txt"
owner: ftpuser@aixunix Send Site-Specific FTP Commands to FTP Servers
Chapter 11: FTP Jobs 313
Send Site-Specific FTP Commands to FTP Servers
When you define an FTP job, you can specify one or more commands to execute prior to
file transfer. You can use this feature to send site-specific FTP commands to FTP servers.
Follow these steps:
1. Define an FTP job (see page 304).
2. Add the following attribute to the job definition:
ftp_command
Defines a command that is to be executed prior to file transfer.
Note: This value includes commands such as locsite but does not include
commands such as cd or lcd.
3. (Optional) Specify additional ftp_command attributes for each command that you
want to run.
4. Run the job.
The site-specific FTP command is sent to the FTP server.
Note: For more information about JIL job types and other job definition attributes, the
values that you can specify for those attributes, and JIL syntax, see the Reference Guide.
E
Example: Send FTP Commands to an FTP Server
This example sends two FTP commands to the FTP server prior to transferring a file.
insert_job: CYBJK.FTP
job_type: FTP
machine: ftpagent
ftp_server_name: ftp.ca.com
ftp_server_port: 21
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: B
ftp_compression: 8
ftp_remote_name: /pub/cazip.exe
ftp_local_name: /tmp/bla
ftp_command: locsite blksize=FB
ftp_command: locsite automount
owner: user1@ftp.ca.com Verify the FTP Job Status
314 User Guide
Verify the FTP Job Status
You can verify that the transfer completed successfully without file corruption.
To verify that the transfer completed successfully, check the job's spool file for the
following responses:
■ If the data was transferred using SSL FTP, the spool file contains the following
response:
AUTH TLS
234 AUTH command OK. Initializing SSL connection.
■ If the data was compressed and transferred without file corruption, the spool file
contains a response as follows:
Downloaded 81920/26119 bytes (original/compressed) in 0.161 seconds, 496.89
Kbytes/sec.
■ If the file was downloaded successfully, the spool file contains the following
response:
Download successful
No comments:
Post a Comment
Note: only a member of this blog may post a comment.