This chapter describes the UNIX-to-UNIX Copy Program (UUCP). Using UUCP enables you to:
Perform tasks on a remote host (Section 14.3.2.3)
Transfer files between a local and remote host (Section 14.5)
Work in background mode
Switch back and forth between the local and remote host, performing tasks on either or both, concurrently
For additional information on UUCP, see the
uucp_intro
(7)
With UUCP, you can connect over a hardwired asynchronous line, a network or a telephone line (using modems at both ends) to:
Another workstation
Another computer running a UNIX based operating system
A computer running an operating system that is not UNIX based (this requires certain hardware and software)
14.1 UUCP Pathname Conventions
UUCP pathnames follow the same conventions as the operating system with the following exceptions:
Relative pathnames may not work with all UUCP commands. In such a case, reenter the command and use the full pathname.
On hosts
that support UUCP, the
/usr/spool/uucppublic
directory
is set up for transferring data among other hosts.
The brief form of this
directory is
~uucp
.
The pathname for a file on a remote host requires an exclamation
point, (!
) after the host name.
For example,
sea!/research/new
specifies the file
new
in the
directory
/research
on host
sea
.
Sometimes to specify a file, you must provide the names of
the remote hosts along the network path.
To do so in the Bourne, Korn, or POSIX shell,
put an exclamation point (!
) after each host name.
For
example,
gem!car!sea!/research/cells
specifies the file
cells
in directory
/research
on host
sea
, which is reachable through host
car
;
car
is reachable through host
gem
.
In the C shell,
the exclamation point (!
) will be mistranslated unless
you precede it with a backslash (\
), for example:
gem\!car\!sea\!/research/cells
14.2 Finding Hosts that Support UUCP
To communicate with a remote host by using UUCP commands from your local
host, you must determine which other hosts support the UUCP protocol.
The
UUCP
uuname
utility displays a list of all hosts with which
you can communicate using UUCP from your local host.
The following example
shows the
uuname
command with output.
% uuname elvis fab4 Y107
This example shows that three remote hosts are accessible to the local
host through UUCP.
To identify the local host, use the
-l
option to the
uuname
command.
For example:
% uuname -l music
By using UUCP commands among compatible hosts, a user on host
music
can send to or receive files from hosts
elvis
,
fab4
or
Y107
.
For more information, see the
uuname
(1)14.3 Connecting to a Remote Host
Before you can use UUCP commands, you must connect your local host to the remote host. There are three commands you can use to connect to a remote host:
The
cu
and
tip
commands
establish a full-duplex connection, giving the appearance of being directly
logged in to the remote host.
This connection enables the simultaneous transfer
of data between the hosts.
The
ct
command establishes a remote connection
by letting you dial an attached terminal and log in through a modem and telephone
line.
Note
A remote connection is subject to the security features on the local and remote host. See your system administrator for more information.
14.3.1 Using cu to Connect to a Remote Host
The
cu
command and its options enable you to connect
to a remote host, log in to it and perform tasks there from your local host.
You can perform tasks on each host by switching back and forth between the
two.
If both hosts use the operating system, you can enter commands on the
remote host from your local host.
14.3.1.1 Using cu to Connect by Name to a Remote Host
The following steps show how to use the
cu
command
to connect from local host
earth
to remote host
moon
, log in to
moon
and enter a command there:
Enter the following
cu
command at the local
system prompt; a message verifies the connection:
earth% cu moon Connected
The login prompt for the remote host will be displayed.
When connecting to some remote hosts, you may need to press the Return key several times before a login prompt is displayed.
Log in to host
moon
at the login prompt.
The system prompt for host
moon
is displayed.
Enter any command that host
moon
supports.
For example, to list the contents of the
/usr/geog/crater/earthside
directory, enter the following command at the system prompt:
moon% ls /usr/geog/crater/earthside copernicus.dat tycho.dat moon%
Note
The preceding example may not work for all
cu
connections. It is used here as a brief, general example. See your system administrator for more information.
After logging in to the remote host, you can switch back and forth between
it and the local host because they run concurrently.
To return to your local
host and enter a command there, type a tilde and an exclamation point (
) followed directly by the command, or wait for the local
host prompt to display and then enter the command.
To return to the remote
host, press Ctrl/D.
14.3.1.2 Using cu to Specify a Directly-Connected Remote Host
To connect to a directly-connected remote host, use the
cu
command with the
-l
option to name the hardwired
line that connects the two computers.
Most of these communication lines have
names that are variations of the standard device name,
tty
.
To use the
cu
command with the
-l
option to connect to a remote host with an unknown name (but which uses hardwired
device
ttyd0
), enter the following command:
earth% cu -lttyd0 Connected
After the connection is made, you can log in to and execute commands
on remote host
moon
.
Refer to the steps in
Section 14.3.1.1.
To return to the local host, type a tilde and an exclamation point (
) followed directly by the command, or wait for the local
system prompt to be displayed before entering the command.
To return to the
remote host, press Ctrl/D.
Note
If you use the
-l
option, but still enter the name of a remote host, no error message will be generated. Instead,cu
will try to connect to the first available line for the requested host name, ignoring the specified line. If it makes the connection, it may not be the one you wanted.
14.3.1.3 Using cu to Connect by Telephone to a Remote Host
You can use
cu
to connect to a remote host, by telephone,
whenever the remote host has not been set up to communicate with the local
host through UUCP.
To do so, the following conditions must be met with:
Both the local and the remote host are connected to modems.
You know the telephone number of the remote modem and have a valid login on that host.
The following example shows how to use the
cu
command
to connect to a remote host that has a long-distance telephone number of 1-612-555-6789.
The
-s
option specifies a transmission rate of 300 baud.
Assuming that dialing 9 is necessary for an outside dial tone, enter the following
cu
command at the local system prompt:
earth% cu -s300 9=16125556789 Connected
After the connection is made, you can log in to and execute commands on the remote host. (Refer to the steps in Section 14.3.1.1).
To return to the local host, type a tilde and an exclamation point (~!
) followed directly by the command, or wait for the local system
prompt to display before entering the command.
To return to the remote host,
press Ctrl/D.
If you do not use the
-s
option to specify a transmission
speed, an appropriate rate is selected by default from data in
/usr/lib/uucp/Devices
.
For added security use the
-n
option, which prompts
you for the telephone number.
This suppresses the display of the phone number
with the
ps
command, which would otherwise display the
number with the
cu
command that you enter.
Table 14-1
summarizes the
cu
command options and entries.
See the
cu
(1)Table 14-1: Options to the cu Command
Option | Description |
-sspeed |
Specifies the rate at which data is
transmitted to the remote host.
The default rate, set during UUCP installation
and based on data in
|
-e | -o |
Specify
-e
for even or
-o
for odd parity for data sent to the remote host. |
-h |
Specify
-h
to emulate
local echoing, to support calls to other hosts that expect terminals to be
set to half-duplex mode. |
-d |
Specify
-d
to print diagnostic
traces. |
-n |
Specify
-n
to have
cu
prompt for a telephone number (for added security) |
-lline |
Specifies the name of a device (line)
for the communication between two computers.
The default is either a hardwired
asynchronous line or a telephone line with an automatic dialer such as a modem.
If your site has several communication lines, you may want to specify a particular
line for your
Usually, you do not
have to specify a line or device; the default established during UUCP installation
should be sufficient.
If you want to connect to a remote computer but do not
know its name, you can enter the
|
-t |
Dials a terminal that has been set to
auto-answer
and maps
carriage return
to
carriage return/linefeed . |
host_name |
Specifies the name of the remote host with which you want to establish a connection. |
telno |
Specifies the telephone number in a remote connection using a modem. |
While connected by
cu
to a remote host, you can use
local
cu
commands to perform the following tasks:
Go back and forth between the local and remote hosts
Change directories on the local host
Copy files between local and remote hosts
Terminate a remote connection
To return temporarily to the local host to work, type a tilde and an
exclamation point (
) at the remote system prompt;
wait for the local system prompt to be displayed in the following form, where
local
is the name of the local host:
~
[
local
]
!
Instead of waiting for the local system prompt to be displayed, you
can enter the command immediately after typing the
~!
that
accesses the local host.
For example, while connected by
cu
to remote host
moon
, you can enter the following command
to return to local host
earth
and use the
cat
command to read the
/usr/crew/r2/asimov/AI
file:
moon% ~!cat /usr/crew/r2/asimov/AI
There are three
cu
local commands for tasks that
are performed very often.
You enter these commands from the remote host to
perform tasks on the local host while you continue working on the remote host.
These commands are preceded by a tilde and a percent symbol:
~%cd
directory_name |
Changes the directory on the local host |
~%take
from
[to] |
Copies a file from the remote host to the local host |
~%put
to
[from] |
Copies a file from the local host to the remote host |
For example, while connected by
cu
to remote host
moon
, you can change the current directory on local host
earth
from
/usr/geog/ocean
to
/usr/geog/ocean/pacific
by entering the following command:
moon% ~%cd pacific
While connected by
cu
to remote host
moon
, you can copy the file,
/usr/ETI/clavius
to
the file
/usr/NASA/decode
on local host
earth
by entering the
~%take
local command at the
remote system prompt:
moon% ~%take /usr/ETI/clavius /usr/NASA/decode
While connected by
cu
to remote host
moon
, you can copy the local file
/usr/NASA/jupiter
to the file,
/usr/ETI/clavius/hal9
on the remote host by
entering the
~%put
local command at the remote system prompt:
moon% ~%put /usr/NASA/jupiter /usr/ETI/clavius/hal9
Note
Before using the
~%take
and~%put
commands, ensure that the destination directory exists. Unlike theuucp
command, thesecu
local commands do not create intermediate directories during file transfers.
You can transfer only ASCII files with
~%take
and
~%put
.
(For example, a PostScript file is an ASCII file, but an
executable file is not.)
14.3.1.5 Using cu to Connect a Local Host to Several Remote Hosts
You can enter the
cu
command to connect host
X
to host
Y
, log on to host
Y
and then enter the
cu
command there to connect to host
Z
.
You then have one local host,
X
and two remote
hosts,
Y
and
Z
.
You can run an operating system command on host
Z
after you log in there.
Then, from
Z
, you can run commands
on the other hosts as follows:
To run a command on host
X
, prefix the
command with a single tilde (
)
To run a command on host
Y
, prefix the
command with two tildes (
)
Table 14-2
summarizes the most common
cu
local commands.
For information about other
cu
local commands, see the
cu
(1)Table 14-2: Local cu Commands
Command | Description |
|
Logs you off the remote host and terminates the remote connection. When connected to the remote host over
a telephone line using a modem, this command does not always work.
In such
cases, press Ctrl/D to log off; then type a tilde and a period ( |
|
Returns the session from the remote
host to the local host.
Type a tilde and an exclamation point ( After establishing the
|
|
Changes the current directory on the local
host to that specified by the
directory_name
variable.
If no directory name is specified,
cu
changes
it to your home directory. |
|
Copies a file from the remote to the local
host.
If you do not specify a
dest
destination file on the local host, the
~%take
command
copies the remote file to the local host and assigns the same file name. |
|
Copies a file from the local to the remote
host.
If you do not specify a
dest
destination file on the remote host, the
~%put
command
copies the local file to the remote host and assigns the same file name. |
|
Executes the
cmd
command on the local host and sends the output to the remote host for execution
by the remote shell. |
14.3.2 Using tip to Connect to a Remote Host
The
tip
command and its options enable you to connect
to a remote host, log in to it and perform tasks there from your local host.
You can do tasks on each by switching back and forth between the two hosts.
If both hosts use the operating system, you can enter commands on the remote
host from your local host.
14.3.2.1 Using tip to Connect by Name to a Remote Host
The following steps show how to use the
tip
command
to connect from local host
earth
to remote host
moon
, log in to
moon
and enter a command there:
Enter the following
tip
command at the
local system prompt; a message verifies the connection:
earth% tip moon Connected
The login prompt for the remote host will be displayed.
When connecting to some remote hosts, you may need to press the Return key several times before a login prompt is displayed.
Log in to host
moon
at the login prompt.
The system prompt for host
moon
is displayed.
Wait for the system prompt, then enter any command that host
moon
supports.
For example, to list the contents of the
/usr/geog/crater/darkside
directory, enter the following command
at the system prompt:
moon% ls /usr/geog/crater/darkside copernicus.dat tycho.dat moon%
Note
The preceding example may not work for all
tip
connections. It is used here as a brief, general example. See your system administrator if necessary.
After logging in to the remote host, you can switch back and forth between
it and the local host because they run concurrently.
To return to your local
host and enter a command there, type a tilde and an exclamation point (
) followed directly by the command or wait for the local
host prompt to display and then enter the command.
To return to the remote
host, press Ctrl/D.
14.3.2.2 Using tip to Connect by Telephone to a Remote Host
You can use the
tip
command to connect by telephone
to a remote host if the following conditions are met with:
Both the local and the remote host are connected to modems.
You know the telephone number of the remote modem or there
is an entry for the remote host in
/etc/remote
.
The following steps show how to use
the
tip
command to connect to a remote host that has the
local telephone number 555-1234, using a transmission rate of 300 baud:
Enter the following
tip
command at the
local prompt,
jupiter
; a message verifies the connection:
jupiter% tip -300 5551234 Connected
Press the Return key. When connecting to some remote hosts, you may need to press the Return key several times before the remote host's login prompt is displayed.
Log in at the remote host login prompt. The connection to your local host is still open, so you can work on the local or remote host.
Note
If you do not specify a transmission speed, the
tip
command uses a 1200-baud rate by default.
The following steps show how to use the
tip
command
to connect, using a 300-baud transmission rate, to a remote host that has
a long-distance telephone number of 1-612-555-9876.
Assuming that you must dial 9 for an outside dial tone, enter
the following
tip
command at the prompt of local host
earth
; a message verifies the connection:
earth% tip -300 9,16125559876 Connected
Press the Return key. When connecting to some remote hosts, you may need to press the Return key several times before the remote host's login prompt is displayed.
Log in at the remote host login prompt. The connection to your local host is still open, so you can work on the local or remote host.
For information about customizing the
/etc/remote
and
/etc/phones
files, see
Network Administration
and the
remote
(4)phones
(4)
Table 14-3
summarizes the
tip
command options and entries.
See the
tip
(1)Table 14-3: Options to the tip Command
Option | Description |
|
Specifies data transmission rate to the remote host. The default rate is 1200 baud. The baud rate, set when UUCP is installed and customized for your site, is configured according to the hardware used to establish connections. |
|
Displays any variables as they are read (verbose)
from the
.tiprc
file. |
|
Specifies the remote host to which you want
to connect; the
tip
command connects over a hardwired line
or a telephone line using a modem, depending on how your system communication
is set up between the local and remote hosts. |
|
Specifies the telephone number in a remote
connection, using a modem.
Use this method when the remote host name is not
recognized by
tip
(that is, there is no entry in the
/etc/remote
file). |
While connected by
tip
to a remote host, you can
use local commands to perform the following tasks:
Go back and forth between the local and the remote host
Change directory on the local host from the remote host
Copy files between local and remote hosts
Terminate a remote connection
To return temporarily to the local host and enter commands there, type
a tilde and exclamation point (
) at the remote
system prompt.
The local system prompt will display in the following form,
where
shell
is the name of the
local shell and
pmt
is the prompt
for the local shell, either
%
for the C shell or
$
for the Bourne, Korn, or POSIX shell:
~
[
shell
]
pmt!
To return to the remote host, press Ctrl/D at the local system
prompt.
To terminate the
tip
process, type a tilde and
press Ctrl/D (
).
You can use the following
tip
commands from the remote
host to perform tasks on the local host while you continue working on the
remote host.
These commands are preceded by a tilde:
~c
directory_name |
Changes the local directory |
~t
from
[to] |
Copies- a file from the remote host to a file on the local host |
~< |
Copies a file from the remote host to a file on the local host |
~p
from
[to] |
Copies a file from the local host to a file on the remote host |
~> |
Copies a file from the local host to a file on the remote host |
For example, while connected by
tip
to remote host
moon
, you can change the current directory on local host
earth
, from
/usr/geog/polar
to
/usr/geog/polar/arctic
by entering the following command:
moon% ~c arctic
While connected by
tip
to remote host
moon
, you can copy the
/usr/darkside/temp/dat
file
to the
/usr/NASA/bios/temp
file on local host
earth
by entering the following command:
moon% ~t /usr/darkside/temp/dat /usr/NASA/bios/temp
While connected by
tip
to remote host
moon
, you can copy the local
/usr/NASA/bios/warn
file to the
/usr/darkside/temp/change
file on the remote
host by entering the following command:
moon% ~p /usr/NASA/bios/warn /usr/darkside/temp/change
Note
You can only transfer ASCII files with the
~t
and~p
commands. (For example, a PostScript file is an ASCII file, but an object (code) file is not.)Neither
~t
nor~p
checks for file transfer errors; theuucp
command provides this verification.
14.3.2.4 Using tip to Connect a Local Host to Several Remote Hosts
You can enter the
tip
command to connect host
X
to host
Y
, log on to host
Y
and then enter the
tip
command there (if
Y
supports
tip
) to connect to host
Z
.
You then have one local host,
X
and two remote hosts,
Y
and
Z
.
You can run an operating system command on host
Z
(if
Z
is a host) after you log in there.
Then, from
Z
, you can run commands on the other hosts as follows:
To run a command on host
X
, prefix the
command with a single tilde (
).
To run a command on host
Y
, prefix the
command with two tildes (
).
Note
A command sequence that begins with a tilde (
) can be interpreted by
~ tip
only if it is at the beginning of the command line.
Table 14-4
summarizes the most common
tip
local commands.
For information about other
tip
local commands, see the
tip
(1)Table 14-4: Local tip Commands
Command | Description |
|
Logs you off the remote host and terminates the remote connection. When connected to the remote host over
a telephone line using a modem, this does not always work.
In such cases,
press
|
|
Returns the session from the remote
host to a shell on the local host.
Type a tilde and an exclamation point ( After establishing the
|
|
Changes the current directory on the local
host to that specified by the
directory_name
variable.
If no directory name is specified,
tip
changes
it to your home directory. |
|
Copies a file from the remote to the local
host.
If you do not specify a
dest
destination file on the local host, the
~t
command copies
the remote file to the local host and assigns the same file name. |
|
Copies a file from the local to the remote
host.
If you do not specify a
dest
destination file on the remote host, the
~p
command copies
the local file to the remote host and assigns the same file name. |
|
Copies a file from the remote to the local
host; the
tip
command prompts for the command string that
will be used on the remote host to display the remote file and the name of
the local file, for example,
cat
filename . |
|
Copies a file from the local to the remote
host; the
tip
command prompts for the name of the local
file and sends the file to the remote host as if it were standard input.
You
should set up a command on the remote host to accept this input before executing
the
~>
command.
For example,
remote%
cat >
destination-file . |
Note
The
tip
command uses system prompts and character sequences that match a system's interrupt sequence to signal the end of file transfers through the~<
or~>
command. These values are configured in the/etc/remote
file. See thereference page for more information. remote
(4)
14.3.3 Using ct to Connect to a Remote Terminal with a Modem
The
ct
command enables a user on a remote ASCII terminal
with a modem to communicate with a local host with a modem over a telephone
line.
The remote terminal user can then log in and work on the local host.
If there are no available telephone lines, the
ct
command
displays a message and asks if you want to wait for one.
The
ct
command is useful:
When secure communications are needed.
Because the local host contacts the remote terminal, the remote user
does not need to know the telephone number of the local host.
The local user
entering
ct
can monitor the work of the remote user.
When the cost for the telephone connection should be charged either to the local site or to a specific account on the remote terminal (like a collect call).
The
-h
option can be omitted to emulate making a
collect call.
The user on a remote terminal enters the
ct
command without the
-h
option.
The following
ct
features are useful under certain
circumstances:
You can instruct
ct
to continue dialing
a number until the connection is established or until a set length of time
has elapsed.
You can specify more than one telephone number and
ct
can dial each modem until a connection is established.
Note
Usually, a user on the remote terminal calls the user on the local host to request a
ct
session. If such connections occur often, your system manager may want to set up UUCP so that a local host automatically entersct
to one or more specified terminals at a designated time. For information about customizing UUCP, see your system administrator.
For example, to connect to a remote terminal modem at the same site as yours, enter the following command. The remote modem has a telephone number of 7-6092:
earth% ct 76092 Allocated dialer at 1200 baud Confirm hang_up? (y to hang_up)
After entering the command, a message verifies the connection and prompts you to either hang up any other phone lines currently in use or cancel the command.
The following example shows how to use the
ct
command
to connect to a remote terminal modem with a local telephone number of 555-0043,
specifying 9 for an outside line and the
-w
option for
a 2-minute wait for the modem line:
earth% ct -w2 9=5550043 Allocated dialer at 1200 baud Confirm hang_up? (y to hang_up)
As before, you are prompted to either hang up any other phone lines currently in use or cancel the command.
The following example shows how to use the
ct
command
to connect from local host
earth
, to a remote terminal
modem with a long-distance number of 1-201-555-7824, specifying 9 for an outside
line and the
-w
option for a 5-minute wait for the modem
line:
earth% ct -w5 9=12015557824 Allocated dialer at 1200 baud Confirm hang_up? (y to hang_up)
You are prompted to either hang up any other phone lines currently in use or cancel the command.
See the
ct
(1)
Table 14-5
summarizes
ct
command options and required entries.
Table 14-5: Options to the ct Command
Option | Description |
|
Specifies the maximum length of time
in minutes that the
Using the
|
|
Produces detailed information about the command's
execution on standard error output on the local host, to be used for debugging.
The debugging level,
number ,
is a single digit in the range from 0-9; the recommended default is 9. |
|
Enables the
ct
command
to send a running narrative to standard error output. |
|
Prevents
ct
from breaking
the current connection. |
|
Specifies the data transmission rate of
ct ; the default is 1200-baud.
Set the baud rate to the baud rate
of the terminal to which you are connecting. |
|
Specifies the phone number of the remote
modem.
You can enter a local or a long-distance number and specify secondary
dial tones such as
Use an equal sign (
|
14.4 Using uux to Run Commands on Remote Hosts
The
uux
command enables you to run commands on a
remote host while you work on your local host.
If these commands do not exist
on the remote host,
uux
does not execute and the remote
host will notify you of this by mail.
If the command executes and produces
output (for example,
cat
or
diff
), you
can program
uux
to place that output in a file on any
particular host.
Note
For security reasons, certain sites may restrict the use of some commands through
uux
. Also, enhanced security features on the local host may affect the execution of certain commands on remote hosts throughuux
. See your system administrator for more information.
The
uux
command syntax depends on how the command
interpreter of a given shell treats special characters.
The syntax is the
same for the Bourne, Korn, and POSIX shells, but different for the C shell.
Regardless of the shell from which you use
uux
, there
are two ways to specify the destination:
uux
[ option...
]
"commandstring
>
destination"
uux
[ option...
]
commandstring
\{
destination
\}
In the first syntax statement, the right-angle bracket (the redirection
symbol) (>
) directs the output of the remote command to
a destination directory or file.
A pair of double quotation marks (" ") encloses
the entire command because the redirection symbol, the right-angle bracket
(>)
, is a special character.
Whenever you use any of the following
characters in a command line, you must enclose that character or the entire
command in double quotation (" ") marks:
Left-angle bracket
(<)
Right-angle bracket
(>)
Semi-colon
(;)
Vertical bar or pipe
(|)
Plus sign
(+)
Left-bracket
([)
Right-bracket
(])
Question-mark
(?)
In the second syntax statement, enclose the destination name within
braces
({ })
.
You must type a backslash (\
)
before each brace because braces are special characters to the shell command
interpreter.
Without backslashes, the braces would be misinterpreted.
When specifying the pathname of a destination file, you can use a full
name or a pathname preceded by
~
user
where
user
is the name of the user's login directory.
The output files must have 'write' permission status.
If you are uncertain
about the permission status of a specific target output file, direct the results
of the command to the
/usr/spool/uucppublic
directory;
~uucp
is a brief way of specifying this directory from a shell.
14.4.1 Using uux from the Bourne, Korn or POSIX Shells
The following example shows how the
uux
command uses
the operating system
cat
command to concatenate the
/u/doc/F1
file located on host
gem
, with the
/usr/doc/F2
file located on host
sky
.
The result
is placed in the
/u/doc/F3
file on host
gem
.
uux "gem!cat gem!/u/doc/F1 sky!/usr/doc/F2 > gem!/u/doc/F3"
In the following example, the task is the same as in the previous command,
but braces ({ }
) are used instead of the redirection symbol
to specify the destination in the
uux
command line.
The
task is the same as in the previous command, but the destination output is
implicit:
uux gem!cat gem!/u/doc/F1 sky!/usr/doc/F2 \{gem!/u/doc/F3\}
14.4.2 Using uux from the C Shell
To perform the same operation as in the previous section, but in the C shell,
enter one of the following
uux
commands:
uux "gem\!cat gem\!/u/doc/F1 sky\!/usr/doc/F2 > gem\!/u/doc/F3"
The following example uses an implicit destination output file:
uux gem\!cat gem\!/u/doc/F1 sky\!/usr/doc/F2 \{gem\!/u/doc/F3\}
In the two following examples,
uux
uses the
cat
command to send the
acct6
file from remote
host
boston
, as output to the
acct6
file in the public directory on your local host:
uux "cat boston\!/reports/acct6 > ~uucp/acct6"
The following example uses an implicit destination output file:
uux cat boston\!/reports/acct6 \{~uucp/acct6\}
14.4.3 Other uux Features and Suggestions
The
uux
command assumes that your local host is the
default, so you do not need to specify it in the command line.
For example,
to run the
diff
command to compare the
/u/F1
file on host
car
with the
/u/F2
file
on host
sea
and place the result in the
/u/F3
file on the local host, use the following command:
uux "diff car!/u/F1 sea!/u/F2 > /u/F3"
You can also represent the local host by using just an exclamation point, as in the following example:
uux "!diff car!/u/F1 sea!/u/F2 > !/u/F3"
When you specify the pathname source file in commands such as
diff
or
cat
, you can include the following shell
pattern-matching characters which the remote host will interpret:
?
)
*
)
[
)
]
)
Enclose these characters either within two backslashes (\ ...
\
) or within quotation marks (" ...
"
) so
that the local shell does not interpret the characters before
uux
sends the command to the remote host.
Do not use pattern-matching
characters in destination names.
If you use the left-angle bracket (<
), the right
angle-bracket (>
), the semi-colon (;
)
and the pipe (|
) shell characters, place them within backslashes
(\ ...
\
), quotation marks (" ...
"
) or place the entire command line within backslashes or quotation
marks.
Note
The shell redirection characters, two left-angle brackets (
<<
) and two right-angle brackets (>>
), do not work in UUCP.
Table 14-6
summarizes
uux
command options and required entries.
See the
uux
(1)Table 14-6: Options to the uux Command
Option | Description |
|
Cancels notification through
The
|
|
Sends a message through
The
|
|
Displays the job identification number of
the
uux
request that runs the remote command; use this
number with the
uustat
command.
See Section 13.8.1 for
more information. |
|
Specifies any command accepted by the designated host. For more information on the command formats, see Section 13.4. |
|
Specifies the host and file for storing the
output of the command run on a remote host.
For example, if you want to list
all the files in a directory on a remote host, you can use
uux
to place the listing in a file on your own host by entering the appropriate
destination name.
For more information on the destination formats, see Section
13.4. |
14.5 Using UUCP to Send and Receive Files
On UNIX-based computers that support the UUCP protocol, you can use
the
uucp
command to copy one or more files from one computer
to another.
You can use
uucp
to copy files as follows:
Between local and remote hosts
Between two remote hosts
Between two hosts through an intermediate host
Within your local host
To facilitate file transfers, many sites make the public UUCP directory,
/usr/spool/uucppublic
, available.
This directory provides read and
write access to all users and bypasses security restrictions.
The brief way
to specify this directory is
~uucp
or
~/
in a
uucp
command.
Note
File transfer through
uucp
is subject to security features on either host. Theuucp
utility does not display error messages for failed file transfers. For more information, see your system administrator.The system administrator defines security restrictions to prevent unwarranted use by remote users. Therefore only certain directories and files are accessible for transfer.
14.5.1 Using UUCP to Copy Files in the Bourne, Korn and POSIX Shells
From the Bourne, Korn, or POSIX shell, you can specify
uucp
file
names without using a backslash (\
) before the exclamation
point (!
) that precedes the host name of the destination
file.
For example, to copy the
star
file from local host
earth
to the
/sun/stats
file in the public directory
on the remote host
sky
, enter the following command:
earth% uucp star sky!~/sun/stats
To copy the same file and explicitly identify the
/usr/spool/uucppublic
directory, enter the following command:
earth% uucp star sky!/usr/spool/uucppublic/sun/stats
If you need to copy a file to a remote host whose address is unknown
to your local host, you can do so by means of another host that knows the
remote host's address.
You can copy a local file to a remote host by first
sending it to one or more intermediate hosts, separating each host name by
an exclamation point (!
).
For example, to copy the local
file
star
to the
/sun/stats
file on
the remote host
sky
by first sending it through the intermediate
host,
mlkway
, enter the following command:
earth% uucp star mlkway!sky!~uucp/sun/stats
You can use
uucp
from your local
host to copy a file from a remote host to your local host.
For example, to
copy the
/cells/type1
file from remote host
biochem
to the local file,
/dna/sequence
, enter the
following command from local host
earth
:
earth% uucp biochem!/cells/type1 /dna/sequence
You can copy multiple files from a remote host to a local host by using
a pattern-matching character to specify files.
For example, to copy all files
with names beginning with
report
from the
/geog/survey
directory on remote host
moon
to the
~uucp
public directory on local host
earth
, enter
the following command:
earth% uucp moon\!/geog/survey/report* ~uucp
14.5.2 Using UUCP to Copy Files in the C Shell
In the C shell, the exclamation point (!
) has a
special meaning.
To prevent the command interpreter from mistranslating it,
you must precede it with a backslash (\
) in a pathname.
For example, to copy the
/usr/NASA/ctrl-specs
file
from local host
earth
to the
~uucp
public
directory on remote host
luna7
, enter the following command
from the local host:
earth% uucp /usr/NASA/ctrl-specs luna7\!~uucp
To copy the
plan9
file from the
/usr/reports/exobio
directory on remote host
luna7
to the
~uucp
public directory on local host
earth
, enter
the following command:
earth% uucp luna7\!/usr/reports/exobio/plan9 ~uucp
To copy all files with names beginning with
msg
from
the
/sensory/visual/earthrise
directory on the remote host
luna7
to the
~uucp
public directory on local
host
earth
, you can enter the following command:
earth% uucp luna7\!/sensory/visual/earthrise/msg'*' ~uucp
Here, the pattern-matching character, the asterisk (*
)
in the source file names is enclosed within single quotation marks to prevent
misinterpretation.
In the next example, the same files are copied to
~uucp
,
but the entire pathname of the source files is enclosed in double quotation
marks to prevent misinterpretation:
earth% uucp "luna7\!/sensory/visual/earthrise/msg*" ~uucp
Table 14-7
summarizes
uucp
command options and required entries.
See the
uucp
(1)Table 14-7: Options to the UUCP Command
Option | Description |
|
Creates intermediate directories needed when
copying a source file to a destination file on a remote host.
Entering
uucp
with the destination pathname creates the required directory.
The
-d
option is the default. |
|
Prevents creating intermediate directories during the file transfer. |
|
Displays the job identification number of
the transfer operation; use with the
uustat
command to
check transfer status or with
uustat -k
to terminate the
transfer.
See Section 13.8.1 for more information. |
|
Specifies that
uucp
send
mail to the requester to verify copying of destination file on a remote host;
no mail is sent for a local transfer. |
|
Notifies the recipient,
username
on the remote host, that a file has been
sent; no mail is sent for a local transfer. |
|
Specifies the pathname of the file that you want to send or receive. For more information about UUCP pathnames, see Section 13.1. |
|
Specifies the pathname of the file (or directory) that receives the copy. For more information about destination file pathnames, see Section 13.5.1 and Section 13.5.2. |
14.6 Using uuto with uupick to Copy Files
The
uuto
command copies the file you specify to the
public directory on the destination host where it is obtained by the recipient
through
uupick
.
The
rmail
program notifies
the recipient when the file arrives.
Note
Any file transfer is subject to the security features on the local and remote hosts. See your system administrator for more information.
For example, to send the
/usr/bin/data/junk
file
from local host
moe
to user
curly
on
remote host
stooge
, enter the following command:
moe% uuto /usr/bin/data/junk stooge!curly
The
uuto
command copies the file to the
/usr/spool/uucppublic/receive/curly/moe
file on host
stooge
.
Next, the
rmail
utility sends user
curly
a mail message stating that the file has arrived.
User
curly
can then enter the
uupick
command to access
the file and save, move or delete it.
In the following example, user
curly
enters the
uupick
command on host
stooge
; the response from
uupick
follows:
stooge% uupick from system moe: file junk ?
At the
uupick
question mark (?
)
prompt, user
curly
enters the
d
and
q
options to delete the file and exit from
uupick
:
? d ? q
Table 14-8
summarizes the
uupick
file handling options, entered at the
?
prompt.
Table 14-8: Options to the uupick Command
Option | Description |
|
Displays available
uupick
file-handling options. |
[Return] |
Signals
uupick
to get
the next file. |
|
Moves all
uuto
files from
the public directory to the specified directory on the local host; specify
the directory by using a full or relative pathname.
The default is the current
directory. |
|
The
d
option deletes the
current file obtained by
uupick . |
|
Moves a file to a directory specified by either full or relative pathname; the default is the current directory. |
|
Displays the file. |
|
Exits
uupick
without displaying,
moving or deleting any file in the public directory.
You can also press Ctrl/D
to quit. |
|
Returns to the operating system to run a
command.
After
command
executes,
control returns to
uupick . |
See the
uupick
(1)14.7 Using uuto to Send a File Locally
You can also use
uuto
to send a file to another user
on your local host.
However, the recipient does not receive a mail message
indicating the file transfer.
For example, user
shemp
can
send the file
/usr/bin/data/status
to user
larry
on local host
stooge
, where each is logged in:
stooge% uuto /usr/bin/data/status larry
Table 14-9
summarizes
uuto
command options and required entries.
See the
uuto
(1)Table 14-9: Options to the uuto Command
Option | Description |
|
Notifies sender when
|
|
Usually,
The
|
|
The pathname of the source file. |
|
The pathname to the location where
you want to copy the source file.
The
|
14.8 Displaying Job Status of UUCP Utilities
The UUCP utilities include three commands viz.,
uustat
,
uulog
and
uumonitor
.
These commands display status
information about UUCP jobs and are described in the following sections.
14.8.1 The uustat Command
The
uustat
command supports UUCP jobs by providing
the following:
Status information of file transfers requested by
uucp
and
uuto
Status information of command executions requested by
uux
Limited control of jobs queued to run on a remote computer
Cancellation of copy requests from
uucp
Status reports from
uustat
are displayed on your
workstation screen in this basic form; variations depend on the
uustat
option.
jobid date/time status system_name username size file
Note
Any status display operation is subject to the security features on the local and remote hosts. See your system administrator for more information.
Entering
uustat
without options displays the status
information for all the UUCP commands that you have entered since the last
time the holding queue was cleaned up.
To report the status of jobs requested by a specific user, use the
-u
option, as shown here, for user
hugh
:
% uustat -u hugh
Two types of information, each produced by a
uustat
option, are the current queue and the holding queue.
Output of the
uustat -q
command is the current queue, which lists the UUCP jobs
either queued to run or being currently executed on one or more remote hosts.
The output of the
uustat -a
command is the holding queue,
which lists all jobs that have not been executed during a set period of time.
Note
After the set time period has elapsed, delete the entries in the holding queue manually with the
uucleanup
command or automatically through theuudemon.cleanu
script. Theuudemon.cleanu
script has an entry in/usr/spool/cron/crontabs/uucp
which is activated by the/etc/cron
daemon. For more information about cleaning up UUCP queues, see thereference page or your system administrator. uucleanup
(8)
14.8.1.1 Displaying the Holding Queue Output with a uustat Option
To examine the status of all UUCP jobs in the holding queue, enter the
uustat -a
command as shown here with example output:
% uustat -a sunC3113 Thu Jun 04 17:47:25 1999 S sun doc 289 D.car471afd8 gemN3130 Thu Jun 04 09:14:30 1999 R gem geo 338 D.car471bc0a seaC3120 Wed Jun 03 16:02:33 1999 S sea doc 828 /u/doc/tt seaC3119 Wed Jun 03 12:32:01 1999 S sea msg rmail doc
This example output consists of the following seven fields:
Field 1 - job ID of the operation; if you need to cancel
a process that is still on the local computer, you would use this field as
input to the
uustat
command with the
-k
option, for example:
% uustat -k seaC3119
Field 2 - date and time that the UUCP command was entered
Field 3 - S or an R, depending on whether the job sends or receives a file
Field 4 - name of the hosts where the command was entered
Field 5 - user name of the person who entered the command
Field 6 - file size or, in the case of remote execution
(as in the last output line), the name of the remote command (rmail
)
Field 7 - when the size is given in field 6 (as in the first three output lines), the file name is displayed in this field
The file name can be either the name given by the user, such as
/u/doc/tt
or a name that UUCP assigns internally to data files associated
with remote executions, such as
D.car471afd8
To report the status of all UUCP jobs in the holding queue requested
by a specific host, enter the
uustat -s
command as shown
here with example output, for host
sky
:
% uustat -s sky skyNlbd7 Wed Jun 03 12:09:30 1999 S sky doc 522 /user/doc/A skyClbd8 Wed Jun 03 12:10:15 1999 S sky doc 59 D.3b2a12ce4924 skyC3119 Wed Jun 03 12:11:18 1999 S sky doc rmail msg
This output is the same as the output produced by the command
uustat -a -s sky
.
14.8.1.2 Displaying the Current Queue Output with uustat Options
To examine the status of all UUCP jobs currently being executed or queued
to run on each host, enter the
uustat -q
command as shown
here with example output:
% uustat -q sea 3C Mon Jul 13 09:14:35 1999 NO DEVICES AVAILABLE sun 2C Mon Jul 13 10:02:22 1999 SUCCESSFUL gem 1C (2) Mon Jul 13 10:12:48 1999 CAN'T ACCESS DEVICE
This example output consists of the following five fields:
Field 1 - host name
Field 2 - number of files, either command (C
) or executable (X
), in the holding queue for
that host
Field 3 - number of days (if one or more) that the file has been in the holding queue
Field 4 - date and time when UUCP last tried to communicate with the host in field 1
Field 5 - status message of the interaction
See the
uustat
(1)
Table 14-10
summarizes
uustat
command options and required entries.
Table 14-10: Options to the uustat Command
Option | Description |
|
Displays information for all jobs in the holding queue, regardless of the user who entered the original UUCP command. |
|
Cancels the UUCP process specified
by
|
|
Reports the status of your most recent
attempt to communicate with another computer through UUCP.
For example, status
is reported as successful if the UUCP request was executed.
If the job was
not completed, UUCP reports an error message, such as
|
|
Runs a
|
|
Lists the jobs currently queued for each host. These jobs are either waiting to be executed or in the process of executing. If a status file exists for the host, UUCP reports its date, time and the status information. After the process is completed, UUCP removes the job from the current queue. |
|
Rejuvenates the UUCP process specified by the job identification number. This option enables you to mark files in the holding queue with the current date and time, to ensure that the cleanup operation does not delete these files until the allotted job modification time is over. |
|
Reports the status of all UUCP requests
that users have entered to run on the specified
|
|
Reports the status of all UUCP requests
entered by the user
You can use both the
|
14.8.2 Using the uulog Command to Display UUCP Log Files
Whenever the local host uses the
uucp
,
uuto
or
uux
commands, UUCP log files are created.
There is a log file for each remote host and for each daemon.
The
uulog
command displays these log files.
Use
uulog
to display a summary of
uucp
,
uuto
and
uux
command requests by the host.
The uulog command displays the contents of the log file activity of either of the following daemons:
The
uucico
daemon, called by
uucp
and
uuto
The activity of this daemon is logged in
/usr/spool/uucp/.Log/uucico/host
.
The
uuxqt
daemon, called by
uux
The activity of this daemon is logged in
/usr/spool/uucp/.Log/uuxqt/host
.
To display just the
uuxqt
log file, use the
-x
option of
uulog
, as follows:
% /usr/lib/uucp/uulog -x
The
uulog
command also enables you to display the
uucico
log file or the file transfer log for any host or only a
specified number of lines at the end of either log file.
For example, to display
the
uucico
log file for host
sky
, use
the
-s
option as follows:
% /usr/lib/uucp/uulog -s sky
To display the last 40 lines of the file transfer log for host
sky
, use the
-f
option and the number option
as shown:
% /usr/lib/uucp/uulog -f sky -40
Table 14-11
summarizes
uulog
command options and required entries.
Table 14-11: Options to the uulog Command
Option | Description |
|
Performs a
|
|
Prints information about copy requests involving the specified host. If no host is specified, information is displayed for all hosts. |
|
Displays the
|
|
Displays the last
|
The
uumonitor
command is helpful for detecting a
host whose status has changed due to a backlog of jobs, a temporary shutdown
or a change of either the phone number or login password.
The
uumonitor
output consists of the following six
fields:
Field 1 - host name
Field 2 - number of command files queued for the remote host; if too large (for example, 100-1000, depending on the host), then the cause of the backlog should be determined
Field 3 - number of requests for remote execution from the remote host
Field 4 - result of the most recent attempt to connect to the remote host
Field 5 - number of remote host login failures, not including failed dial attempts; if greater than 20, no further attempts are made
Field 6 - time of last status entry
For more information, see the
uumonitor
(8)