Pftp: syntax and options

Terms in italic typeface are option strings you supply. When your option string contains a space or a tab character, you must enclose it in single quotes. The options within [ ] are optional.


pftp 
   -mode put | get
   [-schema schema | -schemafile schemafile]
   -uri uri1 [-open_command cmd][-uri uri2 [-open_command cmd]... ]
   [-ftp_call ftp_command]
   [-user user1 [-user user2...]]
   [-password password1 [-password password2...]]
   [-overwrite]
   [-transfer_type[ascii,binary]]
   [-xfer_mode[ftp,sftp]]
   [[-restartable_transfer [-job_id job_id][-checkpointdir checkpoint_dir]]
|[-abandon_transfer [-job_id job_id][-checkpointdir checkpoint_dir]] 
|[-restart_transfer [-job_id job_id][-checkpointdir checkpoint_dir]]]
Table 1. Pftp2 options
Option Use
-mode -mode put | -mode get

put or get

-uri -uri uri1 [-uri uri2...]

The URIs (Uniform Resource Identifiers) are used to transfer or access files from or to multiple hosts.

There can be multiple URIs.

You can specify one or more URIs, or a single URI with a wild card in the path to retrieve all the files using the wild character pointed by the URI. pftp collects all the retrieved file names before starting the file transfer. pftp supports limited wild carding. Get commands are issued in sequence for files when a wild card is specified. You can specify an absolute or a relative pathname.

For put operations the syntax for a relative path is:


ftp://remotehost.domain.com/path/remotefilename

Where path is the relative path of the user's home directory.

For put operations the syntax for an absolute path is:


ftp://remotehost.domain.com//path/remotefilename

While connecting to the mainframe system, the syntax for an absolute path is:


ftp://remotehost.domain.com/\'path.remotefilename\'

Where path is the absolute path of the user's home directory.

For get operations the syntax for a relative path is:


ftp://host/path/filename

Where path is the relative path of the user's home directory.

For get operations the syntax for an absolute path is:

ftp://host//path/filename

While connecting to the mainframe system, the syntax for an absolute path is:

ftp://host//\'path.remotefilename\'

Where path is the absolute path of the user's home directory.

-open_command -open_command cmd

Needed only if any operations need to be performed besides navigating to the directory where the file exists

This is a sub-option of the URI option. At most one open_command can be specified for an URI.

Example:


-uri ftp://remotehost/fileremote1.dat
-open_command verbose
-user -user username1 [-user username2...]

With each URI you can specify the User Name to connect to the URI. If not specified, the ftp will try to use the .netrc file in the user's home directory.

There can be multiple user names.

User1 corresponds to URI1. When the number of usernames is less than the number of URIs, the last username is set for the remaining URIs.

Example:


-user User1 
-user User2
-password -password password1 [-password password1]

With each URI you can specify the Password to connect to the URI. If not specified, the ftp will try to use the .netrc file in the user's home directory. There can be multiple passwords.

Password1 corresponds to URI1. When the number of passwords is less than the number of URIs, the last password is set for the remaining URIs.

Note The number of passwords should be equal to the number of usernames.

Example:


-password Secret1
-password Secret2
-schema -schema schema

You can specify the schema for get or put operations.

This option is mutually exclusive with -schemafile.

Example:


-schema 'record(name:string;)'
-schemafile -schemafile schemafile

You can specify the schema for get or put operations. in a schema file.

This option is mutually exclusive with -schema.

Example:


-schemafile file.schema
-ftp_call -ftp_call cmd

The ftp command to call for get or put operations. The default is

'ftp'.

You can include absolute path with the command.

Example:


-ftp_call '/opt/gnu/bin/wuftp'.
-force_config_file_parallelism -force_config_file_parallelism

Optionally limits the number of pftp players via the APT_CONFIG_FILE configuration file.

The operator executes with a maximum degree of parallelism as determined by the configuration file.

The operator will execute with a lesser degree of parallelism if the number of get arguments is less than the number of nodes in the Configuration file.

In some cases this might result in more than one file being transferred per player.

-overwrite -overwrite

Overwrites remote files in ftp put mode.

When this option is not specified, the remote file is not overwritten.

-restartable_transfer | -restart_transfer | -abandon_transfer This option is used to initiate a restartable ftp transfer.

The restartability option in get mode will reinitiate ftp transfer at the file boundary. The transfer of the files that failed half way is restarted from the beginning or zero file location. The file URIs that were transferred completely are not transferred again. Subsequently, the downloaded URIs are imported to the data set from the downloaded temporary folder path.

  • A restartable pftp session is initiated as follows:

osh "pftp -uri ftp://remotehost/file.dat

-user user

-password secret

-restartable_transfer

-jobid 100

-checkpointdir 'chkdir'

-mode put

< input.ds"

  • -restart_transfer :If the transfer fails, to restart the transfer again, the restartable pftp session is resumed as follows:

osh "pftp -uri ftp://remotehost/file.dat

-user user

-password secret

-restart_transfer

-jobid 100

-checkpointdir 'chkdir'

-mode put

< input.ds"

  • -abandon_transfer : Used to abort the operation,the restartable pftp session is abandoned as follows:

osh "pftp -uri ftp://remotehost/file.dat

-user user

-password secret

-abandon_transfer

-jobid 100

-checkpointdir 'chkdir'

-mode put

< input.ds"

-job_id This is an integer to specify job identifier of restartable transfer job. This is a dependent option of -restartable_transfer, -restart_transfer, or -abandon_transfer

Example:


-job_id 101
-checkpointdir This is the directory name/path of location where pftp restartable job id folder can be created. The checkpoint folder must exist.

Example:


-checkpointdir "/apt/linux207/orch_master/apt/folder"
-transfer_type This option is used to specify the data transfer type. You can either choose ASCII or Binary as the data transfer type.

Example:


-transfer_type binary
-xfer_mode This option is used to specify data transfer protocol. You can either choose FTP or SFTP mode of data transfer.

Example:


-xfer_mode sftp