696-700.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 147 行
HTML
147 行
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:UUCP</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=39//-->
<!--PAGES=696-700//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="695-696.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch40/701-704.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading12"></A><FONT COLOR="#000077">Transferring Files with UUCP</FONT></H4>
<P>UUCP’s most common use is to transfer files from one machine to another. To transfer files using UUCP, you use the <TT>uucp</TT> command. The syntax of the <TT>uucp</TT> command is</P>
<!-- CODE SNIP //-->
<PRE>
uucp [options] source destination
</PRE>
<!-- END CODE SNIP //-->
<P>The options supported by <TT>uucp</TT> vary a little depending on the version and type of UUCP implementation, but most versions support the following useful options:</P>
<CENTER>
<TABLE WIDTH="80%"><TR>
<TD WIDTH="25%" VALIGN="TOP"><TT>-c</TT>
<TD WIDTH="75%">Do not copy the file to a spool directory before sending.
<TR>
<TD>
<TD>The default action is to copy to a spool directory, and uses the <TT>-C</TT> option to explicitly specify it.
<TR>
<TD VALIGN="TOP"><TT>-f</TT>
<TD>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 <TT>-d</TT> option.
<TR>
<TD VALIGN="TOP"><TT>-m</TT>
<TD>Sends mail to the person who issued the <TT>uucp</TT> command when the copy is complete.
<TR>
<TD VALIGN="TOP"><TT>-nuser</TT>
<TD>Sends mail to user on the remote system when the copy is complete.
</TABLE>
</CENTER>
<P>The default behaviors are usually sufficient for most users, although you may want the <TT>mail</TT> options when you need confirmation of an action.</P>
<P>Both source and destination are the names of files or directories as appropriate, much like the <TT>cp</TT> 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 <TT>data_1</TT> from your local machine’s current directory to the directory <TT>/usr/spool/uucppublic</TT> on the machine <TT>arthur</TT>, use the following command:</P>
<!-- CODE SNIP //-->
<PRE>
uucp data_1 arthur\!/usr/spool/uucppublic
</PRE>
<!-- END CODE SNIP //-->
<P>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 <TT>uucppublic</TT> 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 <TT>/usr/spool/uucppublic</TT> directory, it is up to the remote system’s users to find the file and copy it to its intended destination directory.</P>
<P>If you want to send the same file to the user <TT>bill</TT> on the remote machine and store it in a subdirectory called <TT>/usr/spool/uucppublic/bill</TT> and send mail to both yourself and <TT>bill</TT> when the copy is completed, issue this command:</P>
<!-- CODE SNIP //-->
<PRE>
uucp -m -nbill data_1 arthur\!/usr/spool/uucppublic/bill/
</PRE>
<!-- END CODE SNIP //-->
<P>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 <TT>uucppublic</TT>. The following command will transfer the <TT>bigfile</TT> file from the directory <TT>/usr/tmp</TT> on the machine <TT>chatton</TT> to your <TT>/usr/tparker</TT> directory:</P>
<!-- CODE SNIP //-->
<PRE>
uucp chatton\!/usr/tmp/bigfile /usr/tparker/
</PRE>
<!-- END CODE SNIP //-->
<P>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 <TT>chap</TT> on the remote machine <TT>warlock</TT>’s <TT>/usr/bill/book</TT> directory (assuming you have permission) to your own <TT>/usr/bigbook</TT> directory, issue this command:</P>
<!-- CODE SNIP //-->
<PRE>
uucp “warlock!/usr/bill/book/chap*” /usr/bigbook/
</PRE>
<!-- END CODE SNIP //-->
<P>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:
</P>
<!-- CODE SNIP //-->
<PRE>
uucp arthur\!/usr/lib/uucppublic/bigfile warlock\!/usr/lib/uucppublic/
</PRE>
<!-- END CODE SNIP //-->
<P>This sends the file from the <TT>arthur</TT> system to the <TT>warlock</TT> system. In most cases, the users on either of the two remote systems would issue the commands, relieving some of the file permission problems.</P>
<H4 ALIGN="LEFT"><A NAME="Heading13"></A><FONT COLOR="#000077">Checking on Transfers</FONT></H4>
<P>You can check on the status of transfers that are scheduled but haven’t taken place yet using the <TT>uustat</TT> command. When you issue the <TT>uustat</TT> command, all the UUCP transfers that are queued are listed. The format of the list is</P>
<!-- CODE SNIP //-->
<PRE>
jobID system user date command size
</PRE>
<!-- END CODE SNIP //-->
<P><I>jobID</I> is the ID of the UUCP job, <I>system</I> is the name of the system to transfer to (the first system in an address when multiple hops are taking place), <I>user</I> is the username who queued the job, <I>date</I> is when the job was queued, <I>command</I> is the exact command to be executed, and <I>size</I> is the size of the transfer in bytes.</P>
<P>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 <TT>-a</TT> option:</P>
<!-- CODE SNIP //-->
<PRE>
uustat -a
</PRE>
<!-- END CODE SNIP //-->
<P>To cancel a queued job, use the <TT>-k</TT> option of the <TT>uustat</TT> command along with the job ID. For example, to cancel jobID 17, issue the following command:</P>
<!-- CODE SNIP //-->
<PRE>
uustat -k 17
</PRE>
<!-- END CODE SNIP //-->
<P>You can cancel only your own jobs unless you are logged in as superuser, in which case you can cancel any jobs.
</P>
<H3><A NAME="Heading14"></A><FONT COLOR="#000077">Summary</FONT></H3>
<P>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 <TT>mail</TT> and <TT>cp</TT> commands.</P>
<P>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:</P>
<DL>
<DD>Configuring your system for email is discussed in Chapter 40, “Configuring Linux for Mail.”
<DD>Newsgroups and Linux are discussed in Chapter 41, “Configuring Linux for News.”
<DD>Preventing break-in problems with your system is discussed in Chapter 42, “Network Security.”
<DD>That very important subject of backups is discussed in Chapter 45, “Backups.”
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="695-696.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch40/701-704.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?