DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using UUCP and dialup commands

Using the uucp command

The uucp command is equivalent to the ordinary cp command, but it transfers files between machines. Thus, in addition to specifying a source filename and a destination filename, you need to specify the name of the computer on which the source file is located and the name of the destination computer.

For example, to copy the file testfile from machine kate to machine rachel, if the appropriate permissions are set, you can use the command:

uucp kate!testfile rachel!testfile

The exclamation point (!) separates the host (computer) name from the filename.

Note that, as the exclamation point has special meaning to the C shell, if you are using the C shell you must ``escape'' with a backslash (\) any exclamation points that appear in a uucp command. For a C-shell user, the command above is specified as:

uucp kate\!testfile rachel\!testfile

The format of the uucp(C) command is:

uucp [options] src_computer!src_file dest_computer!dest_file

where:


src_file
Is the name of the file that you want to copy.

src_computer
Is the name of the computer on which src_file is located.

dest_file
Is the name of the copied file on the receiving computer. Usually, src_file and dest_file are the same.

dest_computer
Is the name of the computer on which dest_file is located.

options
Are the optional arguments to the command. Options include:

-j
Prints a job identification number. (The job ID can be used to cancel a pending uucp command.)

-m
Mails the requester when the operation has been carried out.

-nuser
Notifies user (a username on the destination machine) that a file was sent.
There are several ways to specify the location on the remote machine to which you want to transfer the file. The simplest is the ~/dest_file specification. This is also the safest specification, because ~/dest_file is expanded to /usr/spool/uucppublic/dest_file, ensuring that the transfer will succeed.

For example, to send /usr/andrew/transfile on your machine kate to /usr/spool/uucppublic on machine rachel, enter the following command:

uucp /usr/andrew/transfile rachel!~/transfile

This command creates the file /usr/spool/uucppublic/transfile on rachel.

If /usr/andrew is your current directory, you can copy transfile to alice with the following command:

uucp transfile alice!~/transfile

Another form of the command allows you to specify the full pathname of the copied file on the remote computer. However, you must be sure that your computer has write permission on this directory, otherwise the transfer will fail.

As an example, suppose that you want to send /usr/andrew/transfile on machine jane to the /usr/andrew directory on kate. To do so, enter the following command:

uucp jane!/usr/andrew/transfile kate!/usr/andrew/transfile

The uucp command can be used to retrieve files from a remote site, in addition to copying files to a remote site. Using the example above, if you are in the /usr/john directory on jane and you want to retrieve a copy of /usr/andrew/transfile from kate, enter the following command:

uucp kate!/usr/andrew/transfile  /usr/john/transfile

You can also use ~user to specify a location on the remote computer. The ~user argument is expanded to the pathname of user's home directory on the remote computer. For example, suppose /usr/john is the home directory of account john on machine kate. To copy transfile from /usr/andrew on jane to /usr/john on kate, enter the following command:

uucp /usr/andrew/transfile kate!~john/transfile

The receiving computer expands ~john to the full pathname of john's home directory, creating /usr/john/transfile. Again, your computer must have write permission in john's home directory in order for this transfer to succeed.

With the uucp command, files are not copied and sent immediately. Instead, copies are placed in a spool directory and sent once the uucico daemon awakens. uucico dials remote hosts and transfers the files that it finds queued. Depending on how your system is configured, a uucp transfer might take place within minutes or within hours. It is common for uucp transfers via modem to be saved up for transmission while cheap rate telephone calls are in effect; this is done via a system cron(C) job.

Transferring files to systems that are not connected directly to your own

You might be able to send files to a UUCP site that is not connected directly to your own, that is not listed in a uuname listing. For example, your local computer jane is connected to a UUCP site named kate. kate is connected to a UUCP site named alice. You can send /tmp/transfile on your local computer through jane to /usr/spool/uucppublic on alice. To do this, specify the full UUCP address relative to your local computer:

uucp /tmp/transfile jane!alice!~/transfile

Note that each site name in the command line is followed by an exclamation mark. By placing several site names in a uucp command line, you can greatly extend the range of systems to which you can copy files with uucp. This is also true for the uuto and uux commands discussed below.

Checking the status of pending file transfers

You can use the uustat(C) command to check on the status of files copied with uucp. To check on the status of all your uucp jobs, enter uustat to display the following output:

   1234 2/19-10:29 S machine2 mike 9 transfer.file
The fields are as follows:

1234
The job number assigned to this uucp transfer. (This number is unique to uucp and is used to keep track of the queue of files awaiting dispatch).

2/19-10:29
The date and time the job was queued in the spool directory.

S
The status of the job: ``S'' indicates the job is a file to be sent; ``R'' indicates the job is a request.

machine2
The system on which the job will be run.

mike
The login of the user who requested the transfer.

9
The size of the job in kilobytes.

transfer.file
The name of the file.
If the transfer is completed, uustat displays the message:
COPY FINISHED, JOB DELETED.

Several options are available to use with uustat. Refer to uustat(C) for more information.

Transferring files to a public directory using uuto

The uuto command allows you to copy files to the public directory of a UUCP site to which your system is connected. The public directory on most UNIX and XENIX® systems is /usr/spool/uucppublic. For example, to send a file from the machine jane to the machine kate, use:

uuto mytextfile kate!john

john is the login of the user to whom you are sending files; john can retrieve mytextfile, as explained in ``Retrieving files from the public directory''.

Before you can send a file with uuto, you must verify that:


If the permissions are not correct, enter the following commands to set the correct permissions. For example:

chmod o+r mytextfile
chmod o+rx  .

(The dot (.) stands for the current directory.) Files sent with uuto are placed in the directory:

/usr/spool/uucppublic/receive/login/src_computer

where login is the login of the user to whom you are sending files and src_computer is the site name of your system. In the example above, mytextfile is placed in /usr/spool/uucppublic/receive/john/jane.

As an example, suppose that you want to send a copy of transfile in /tmp on jane to the user sara on the machine kate. To do so, enter the following command:

uuto /tmp/transfile kate!sara

This command copies transfile to the following directory:

usr/spool/uucppublic/receive/sara/jane

When the file transfer is complete, the recipient is notified by mail that the file has arrived. If the -m option is used on the uuto command line, the sender is notified by mail of the success or failure of the transfer.

Like uucp, files transferred with uuto are not transferred immediately after the command is entered. Instead, they are placed in a spool directory and sent when the uucico daemon awakens.

Retrieving files from the public directory

In order to retrieve a file sent by uuto, you must use the uupick command. To execute uupick, enter a command like this:

uupick -s system

For example, sara would enter uupick -s jane and the uupick program searches the public directory for any files sent to you from system. If it finds any, it responds with the following prompt:

   from system src_computer: file filename ?
src_computer is the name of the sender's computer and filename is the name of the file transferred. In the example above, if the uuto transfer to sara on kate is successful, sara sees the following uupick prompt:
   from system jane: file mytextfile ?
Several options are available for responding to the uupick prompt. Two of the most useful are m dir and d. The m dir option tells uupick to move the file to directory dir. Once in dir, you can manipulate the file as you would any other file on your system. In the example above, sara enters the following response to the uupick prompt:

m $HOME

This causes mytextfile to be moved from the public directory to sara's home directory. If no directory is specified after m, the file is moved to the recipient's current directory. The file can then be deleted from the public directory by entering d at the uupick prompt. You can quit uupick by entering q. Other uupick options are available; refer to uupick(C) for a complete list.


Next topic: Executing commands on remote UNIX systems
Previous topic: Transferring files between UNIX systems

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003