-->
Previous Table of Contents Next


Transferring Files with UUCP

UUCP’s most common use is to transfer files from one machine to another. To transfer files using UUCP, you use the uucp command. The syntax of the uucp command is


uucp [options] source destination

The options supported by uucp vary a little depending on the version and type of UUCP implementation, but most versions support the following useful options:

-c Do not copy the file to a spool directory before sending.
The default action is to copy to a spool directory, and uses the -C option to explicitly specify it.
-f Don’t create directories on the remote system if needed. The default action is to create directories as needed, and can be explicitly specified with the -d option.
-m Sends mail to the person who issued the uucp command when the copy is complete.
-nuser Sends mail to user on the remote system when the copy is complete.

The default behaviors are usually sufficient for most users, although you may want the mail options when you need confirmation of an action.

Both source and destination are the names of files or directories as appropriate, much like the cp command. However, when you are dealing with a remote system for the source or destination, you need to format the file or directory in valid UUCP address formats. For example, to send the file data_1 from your local machine’s current directory to the directory /usr/spool/uucppublic on the machine arthur, use the following command:


uucp data_1 arthur\!/usr/spool/uucppublic

Notice that the remote machine name was prepended to the full target directory name. In most cases, when transferring files to remote systems you will want to use the uucppublic directories because most likely you will not have permission to transfer files anywhere else in the file system. Once on the remote system in the /usr/spool/uucppublic directory, it is up to the remote system’s users to find the file and copy it to its intended destination directory.

If you want to send the same file to the user bill on the remote machine and store it in a subdirectory called /usr/spool/uucppublic/bill and send mail to both yourself and bill when the copy is completed, issue this command:


uucp -m -nbill data_1 arthur\!/usr/spool/uucppublic/bill/

To copy a file from a remote machine to yours, you need to specify the location of the remote. Remember, you must have access to the directory that the files reside in (as well as read permission on the file), or have the sender copy them to uucppublic. The following command will transfer the bigfile file from the directory /usr/tmp on the machine chatton to your /usr/tparker directory:


uucp chatton\!/usr/tmp/bigfile /usr/tparker/

UUCP allows wildcards to be used, although you must enclose them in quotation marks to prevent the shell from interpreting them. For example, to copy all the files starting with chap on the remote machine warlock’s /usr/bill/book directory (assuming you have permission) to your own /usr/bigbook directory, issue this command:


uucp “warlock!/usr/bill/book/chap*” /usr/bigbook/

You can also specify hops in the machine transfers by adding the extra machine names to the command. This requires permissions to be set on all the machines that the hop will pass through and is seldom done. Although you probably don’t want to do this either, you can transfer files from one remote system to another by specifying their names on the command line like this:


uucp arthur\!/usr/lib/uucppublic/bigfile warlock\!/usr/lib/uucppublic/

This sends the file from the arthur system to the warlock system. In most cases, the users on either of the two remote systems would issue the commands, relieving some of the file permission problems.

Checking on Transfers

You can check on the status of transfers that are scheduled but haven’t taken place yet using the uustat command. When you issue the uustat command, all the UUCP transfers that are queued are listed. The format of the list is


jobID system user date command size

jobID is the ID of the UUCP job, system is the name of the system to transfer to (the first system in an address when multiple hops are taking place), user is the username who queued the job, date is when the job was queued, command is the exact command to be executed, and size is the size of the transfer in bytes.

If you issue the command as a user (not superuser), only your jobs are listed. The super-user lists all jobs that are queued. If you are logged in as a regular user and want to see all jobs, use the -a option:


uustat -a

To cancel a queued job, use the -k option of the uustat command along with the job ID. For example, to cancel jobID 17, issue the following command:


uustat -k 17

You can cancel only your own jobs unless you are logged in as superuser, in which case you can cancel any jobs.

Summary

UUCP is quite easy to set up, as long as you follow the rules. After the configuration files are properly set, UUCP offers an easy way to transfer email, news, and files to other systems. UUCP is also one of the easiest methods to establish a low-volume network because all you need is a modem or a direct connection. Using UUCP to transfer mail and files is as easy as using the usual mail and cp commands.

Although UUCP is less popular nowadays because of the LAN craze, it does provide a simple, very low-cost network for those who need to connect only a couple of machines. It’s also great for connecting your machine to those of your friends, allowing email back and forth, and really making your Linux system act like a well-connected workstation. From here, you can learn about related topics in the following chapters:

Configuring your system for email is discussed in Chapter 40, “Configuring Linux for Mail.”
Newsgroups and Linux are discussed in Chapter 41, “Configuring Linux for News.”
Preventing break-in problems with your system is discussed in Chapter 42, “Network Security.”
That very important subject of backups is discussed in Chapter 45, “Backups.”


Previous Table of Contents Next