Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rcp(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cp(1)

ftp(1)

remsh(1)

remshd(1M)

rcmd(3)

hosts(4)

hosts.equiv(4)

RCP(1)  —  Series 300 and 800 Only

NAME

rcp − remote file copy

SYNOPSIS

rcp [ −r ] file1 [ file2 ... ] target

DESCRIPTION

File is copied to target.  If target is a directory, then one or more files are copied to that directory.  If there is more than one source file, target must be a directory.  If target is a file, its former contents are overwritten and its mode, owner, and group are unchanged.  If target is not a file, a new file is created which has the same mode as file except that the sticky bit is not set unless you are super-user; the owner and group of target are those of the user.  The last modification time of target (and last access time, if target did not exist) and the last access time of file are set to the time the copy was made.  If target is a link to a file, all links remain and the file is changed. 

Target and each file may be either a local file name (with a ‘/’ before any ‘:’), or a remote file name of the form “host-name:path”. Host-name can be either an official host name or an alias (see hosts(4)). If host-name is of the form “rhost.ruser”, ruser rather than the current user name is used on the remote host.  An unspecified path (i.e.  “host-name:”) refers to the remote user’s login directory. If path does not begin with ‘/’, it is interpreted relative to the remote user’s login directory on rhost. Shell metacharacters in remote paths may be quoted, with backslash (\) or single (’’) or double quotes (""), so that they will be interpreted remotely. 

Rcp −r recursively copies the contents of source directories to a target directory.  If there is exactly one source file, and it is a directory, and target has the same name as file, then each subtree of file is copied beneath target. Otherwise, the source directory itself as well as its subtrees is copied beneath target. If none of the source files are directories, the −r option has no effect. 

Rcp does not prompt for passwords. The current local user name or any user name specified via ruser must exist on rhost and allow remote command execution via remsh(1) and rcmd(3). Remshd(1M) must be executable on the remote host.

Third-party transfers of the form:

rcp rhost1.ruser1:path1 rhost2.ruser2:path2

are performed as:

remsh rhost1 -l ruser1 rcp path1 rhost2.ruser2:path2

Therefore, for a such a transfer to succeed, ruser2 on rhost2 must allow access by ruser1 from rhost1 (see hosts.equiv(4)).

RETURN VALUE

Rcp returns 0 if all transfers succeeded.  Otherwise it returns the number of transfers which failed. 

WARNINGS

Rcp is confused by any output generated by commands in a .cshrc file on the remote host (see csh(1)).

Copying a file to itself, for example:

rcp path ‘hostname‘:path

may produce inconsistent results.  The current HP-UX version of rcp simply copies the file over itself.  However, some implementations of rcp, including some earlier HP-UX implementations, corrupt the file. In addition, the same file may be referred to in multiple ways, for example, via hard or symbolic links, RFA (NS), or NFS, or in an HP-UX cluster environment (Series 300 only). It is not guaranteed that rcp will correctly copy a file over itself in all cases. 

DEPENDENCIES

Implemented on the Series 300 and 800 only. 

AUTHOR

UCB (University of California at Berkeley)

SEE ALSO

cp(1), ftp(1), remsh(1), remshd(1M), rcmd(3), hosts(4), hosts.equiv(4). 
 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026