dscopy(1)
Requires Optional NS/9000 Software
NAME
dscopy − copy files between NS systems
SYNOPSIS
dscopy copydescriptor
dscopy -i
DESCRIPTION
dscopy is a Network File Transfer (NFT) command that:
• Copies files between HP9000 HP-UX, HP1000, and HP3000 systems, and HP PCs in a network, provided each system is equipped with the appropriate networking software.
• Translates file attributes automatically as appropriate when transferring files between dissimilar systems, and when explicitly specified by the user.
• Can be used to access remote accounts if the user supplies the correct login and password information.
This manual entry discusses file transfers between HP-UX systems only. Refer to the NS Cross-System NFT Reference Manual for information about copying files between dissimilar systems.
File Copying Formats
NFT uses two file copying formats:
Transparent Format Default for transfers between similar systems, even if the transfer is initiated from a third, dissimilar system. Each file is copied directly from one system to the other without alteration.
Interchange Format Default for transfers between dissimilar systems such as between HP1000 systems and 3000 or HP-UX systems. Files being copied are converted to Interchange Format which redefines file attributes such that converted files can be handled by any NS system.
Interchange Format can be activated explicitly by specifying one or more of the Interchange Format options when copying a file. Interchange Format options can also be used to give a target file a different set of attributes from those characteristic of the source file from which it was copied, even if the files are being copied between computers of the same type.
Transfers Between HP-UX Systems
When transferring files between HP-UX systems:
• File mode assigned to new file is the same as that of the source file.
• Ownership of the new file is set to the user ID used for the destination system login.
• If the destination system file already exists and is write protected against the destination system file node user ID, dscopy returns an error message. To override write protection of an existing file, use the -r (replace) option described later in this manual entry.
• When processing user login information for a remote HP-UX system, the local HP-UX system prompts for a password with local echo turned off if the login name is followed by a colon but no password is given. The colon character tells the system to prompt you for the password. The login name and password are then passed to the remote computer as two separate entities.
• HP-UX quit and interrupt signals can be used during dscopy operations. quit aborts any transfer in progress and interrupt reports the percentage of completion of the current file transfer.
System Security
Security varies between different types of NS systems. Refer to the NS Cross-System NFT Reference Manual for security information if the source and target nodes are not similar systems.
Interactive and Non-Interactive Transfers
dscopy can be used either interactively or non-interactively (such as from a shell script or program). For interactive transfers, the -i option is used with no other arguments. Non-interactive transfers use a copydescriptor string to specify source, destination, and transfer options.
Interactive Transfers
To initiate an interactive transfer, use the -i option as follows:
dscopy -i
In Interactive Mode, dscopy prompts for a copydescriptor that specifies:
• Type of transfer,
• Login information for source and destination systems as appropriate,
• source and destination file locations.
dscopy then copies the specified file and returns with a prompt for the next copydescriptor, continuing until an end-of-file character (usually Ctrl-D) is received from the keyboard indicating that no more transfers are to be made. (End-of-file character is configurable and may vary between systems.) Upon completion of each file transfer, the connection between the source and target system is maintained, making it unnecessary to respecify node names and logins if subsequent copies are between the same two systems. To change the source or target node from a remote node to the local node, add a prefix of # to the local file name. To change the source and/or target nodes to different remote nodes, respecify the node name and login for each node being changed. Whenever the source or target node specification is changed, NFT terminates the existing connection and establishes a new connection.
Each copydescriptor is constructed as follows:
[option] [option]... [[snode#]slogin#]sfile [[tnode#]tlogin#]tfile
Parameters in copydescriptor are:
option Any of the dscopy options described later in this entry. Multiple options, if used, can appear in any order, and must be separated by a space.
snode
tnode Name of the source node or target node, respectively. NS node names have the following hierarchical structure:
node[.domain[.organization]]
organization, organization and domain, or all parts of the node name can be omitted. When organization, or organization and domain, are omitted, the default is the local organization and/or domain. If the entire node name is omitted, default is the local node.
slogin
tlogin Login and password, if any, at the source or target node, respectively. The login for HP-UX systems must be in the form:
userID:password
where userID is the login name on the source or target system, and password is the password, if any. The colon and password can be omitted if no password exists for the login name (a practice that should be strictly avoided unless system security is not important). If the colon is typed but password is not, the local system prompts for the password with local echo turned off.
The login must be separated from the snode or tnode and sfile or tfile parameters by pound signs (#). If slogin or tlogin is omitted, the corresponding login defaults to the local login.
sfile
tfile Path name of the source or target file, respectively. If the file is a local file, the path name can start from the current working directory or from the local system root directory. If the file is on a remote HP-UX system, the path name can start from the home directory of the login specified in the slogin or tlogin parameter, or from the remote root directory. HP-UX path names can be up to 1023 bytes long. NFT does not support the use of HP-UX wild card characters.
Login and file name syntax varies on non-HP-UX systems. Refer to the NS Cross-System NFT Reference Manual for login and file name syntax on other systems.
Non-Interactive Transfers
dscopy behaves much the same way in non-interactive transfers except that each transfer is an isolated activity where dscopy establishes a connection between the source and destination system, transfers the specified file or files, then terminates the connection between systems upon completion of the transfer.
Non-interactive dscopy commands are constructed as follows:
dscopy [option] [option]... [[snode#]slogin#]sfile [[tnode#]tlogin#]tfile
For a description of parameters shown, refer to the description of copydescriptor in the previous discussion of interactive transfers.
Options
There are two classes of options to the dscopy command. They are part of copydescriptor and precede the file and node specifications.
File Transfer Options Used to control output of status information and to overwrite existing files on the destination (target) system.
File Format Options Used to alter file formats and attributes when copying files between dissimilar systems or to expressly modify file attributes when copying files on a single system or between similar systems.
Although Interchange Format options can be used when copying files on a given system or between similar systems, they are primarily intended for use when copying files between dissimilar systems and are most useful when used for that purpose. Using an Interchange Format option when copying a file between HP-UX systems overrides the default file copying format (Transparent Format) and causes the file to be copied in Interchange Format.
File Transfer Options
The two file transfer options are:
-p (Print Status) Prints dscopy status to the standard output. If -p is not present, no status information is produced.
-r (Replace) Replaces target file, if it exists, with the file being copied. Behavior of this option is determined by system configuration at the source and destination file nodes.
HP-UX-to-HP-UX Mode and ownership of the target file are those of the source file.
HP-UX-to-non-HP-UX Target file protection and/or ownership are the default values defined for the target login.
Non-HP-UX-to-HP-UX Target file is set to mode 666 (rw-rw-rw-).
Non-HP-UX-to-non-HP-UX Target file protection and/or ownership are the default values defined for the target login.
If the -r option is not used and:
HP-UX Target File Exists
File is automatically overwritten by the source file (unless the target file is write protected against the target node login). Target file retains ownership and file mode of the overwritten file.
Non-HP-UX Target File Exists
File is not overwritten and an error is returned.
Interchange Format Options
The following paragraphs describe behavior of Interchange Format options when source and target nodes are both HP-UX systems. Refer to the NS Cross-System NFT Reference Manual for information about other systems.
-A (ASCII option) Intended for use when copying files between dissimilar systems. Not useful when coping files between HP-UX systems.
-B (Binary option) Used for transferring files containing binary data (formatted in 256-byte records). Not useful when copying files between HP-UX systems unless used in conjunction with other Interchange Format options (see -F and -L options below).
-F (Fixed-Length option) Converts “records” in an HP-UX ASCII source file to fixed-length “records” in an HP-UX target file (an HP-UX “record” is considered to be the data found between ASCII LF characters). This option truncates data or adds ASCII space characters between ASCII LF characters in the ASCII source file as necessary, so that the data is 160-bytes long (the default record length). If the -B option is used in conjunction with -F, source file data is divided into records every 256 bytes, and ASCII LF characters found in the source file are considered part of the data. If the last record is less than 256 bytes, it is padded with ASCII NUL characters.
-L
or
-L[n] (Record Length option) Used to change the length of records in an HP-UX ASCII or Binary target file to n bytes. If n is not specified, default is 160 bytes for ASCII files and 256 bytes for Binary files. If n is zero, the record length is set equal to the longest record in the source file. Data between ASCII LF characters in the source file is truncated, if necessary, so that the record does not exceed n bytes in length. This option interprets an HP-UX record as the data found between ASCII LF characters for ASCII files.
-d
-d0nnn
or
-dc (Delimiter Character option) Specifies a delimiter character to be inserted after each record in the target file where nnn is a decimal equivalent of the ASCII value of the character to be used as a delimiter (must be preceded by a zero), or c is the character itself. The -d option with no argument defaults to an ASCII LF.
-s
-s0nnn
or
-sc (Search character option) Specifies a character to be recognized by NFT as a delimiter character when searching through records in the source file. Interpretation of nnn and c is the same as for the -d option.
RETURN VALUE
Exit status values are returned to $? for Bourne and Korn shells and $status for C shell. Values are:
0 Requested transfer completed successfully.
1 Source file or source node is inaccessible.
2 Target file or target node is inaccessible.
3 Syntax error.
4 Transfer began but did not complete successfully.
5 Internal error.
DIAGNOSTICS
Error messages are printed to standard error. These messages are listed in the Using Network Services manual.
EXAMPLES
Interactively copy two files from a remote HP-UX system to the local HP-UX system. After the first file is copied, use the established connection to copy a second file between the same two nodes (it is unnecessary to specify the remote node name and login parameters for the second transfer).
dscopy -i
dscopy>remnode1#logname#/users/lab/sfile /users/testsite/d1file
dscopy>/users/lab/nextfile /users/testsite/d2file
Same as above, but non-interactive mode. Note that the remote node name and login parameters are required in both commands.
dscopy remnode1#logname#/users/lab/sfile /users/testsite/d1file
dscopy remnode1#logname#/users/lab/nextfile /users/testsite/d2file
AUTHOR
dscopy was developed by HP
SEE ALSO
Hewlett-Packard Company — HP-UX Release 9.0: August 1992