📄 423-427.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Configuration and Installation:Linux and the Internet</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=1558285660//-->
<!--TITLE=Linux Configuration and Installation//-->
<!--AUTHOR=Patrick Volkerding//-->
<!--AUTHOR=Kevin Reichard//-->
<!--AUTHOR=Eric Foster//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=9//-->
<!--PAGES=423-427//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="420-423.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="427-430.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading11"></A><FONT COLOR="#000077">A UUCP Primer</FONT></H3>
<P>At its core, the UUCP commands allow machines to communicate directly via network links or telephone connections. They are limited in scope and are geared toward the rudimentary purposes of sending along files, electronic mail, and (sometimes) Usenet news.
</P>
<P>In this chapter, we’ll focus on the few commands you’re likely to use. (If you want information about all of the UUCP commands, check Appendix A for a list of further reading material.) We’ll also avoid configuration issues, which are best left to a system administrator.</P>
<P>Before you use <B>uucp</B>, you need to know what machines are connected to yours. The <B>uuname</B> command does just this:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ uuname
geisha
spike
</PRE>
<!-- END CODE SNIP //-->
<P>Why is this information important? Because you’ll need to specify machine names with the <B>uucp</B> command.</P>
<H4 ALIGN="LEFT"><A NAME="Heading12"></A><FONT COLOR="#000077">Using UUCP</FONT></H4>
<P>The <B>uucp</B> command is used to copy files from one machine to another. At first glance, in this age of Internet and the Information Superhighway, you may think that this is incredibly retro technology. And, conceptually, it is.</P>
<P>Realistically, however, the <B>uucp</B> command has its widest application in the corporate world, where interconnected computers are very common. In these situations, the corporate systems may not be tied to the outside world but only connected to other corporate systems. In these cases, the <B>uucp</B> command is a handy way of transferring a file from your system to the corporate headquarters in Sioux City, Iowa.</P>
<P>The best way to understand the <B>uucp</B> command isn’t to think of it as a strange and unfamiliar networking command—just think of it as an extended version of the common <B>cp</B> command, which you used earlier in this book. Instead of downloading and uploading files from a local directory, you’re using <B>uucp</B> to download and upload files from another machine.</P>
<P>There’s an added advantage to the <B>uucp</B> command: All in all, it’s a rather secure method of transferring files, when everything is set up correctly. (There’s the issue of security popping up again.) The <B>uucp</B> command and the UUCP utilities can enact very specific guidelines on where files can be uploaded to or downloaded from.</P>
<P>Let’s look at a typical <B>uucp</B> command line:</P>
<!-- CODE SNIP //-->
<PRE>
$ uucp chap9.txt spike!/usr/spool/uucppublic/chap9.txt
</PRE>
<!-- END CODE SNIP //-->
<P>While this may seem to be a long command line, a closer look will show that it’s actually rather simple.
</P>
<P>The <B>uucp</B> portion of the command line, obviously, refers to the <B>uucp</B> command. This is followed by the name of the file to be copied (<B>chap9.txt</B>).</P>
<P>The next portion is potentially the most confusing portion for novice users, as it represents the destination of the file by name of the machine and the directory. In this case, <I>spike</I> refers to the name of the machine; the <B>uucp</B> command knows this because the name of the machine ends with an exclamation mark (<B>!</B>).</P>
<P>If the exclamation mark looks familiar, it should; remember, the Usenet method of electronic-mail addressing with bang paths makes heavy use of exclamation marks.</P>
<P>The exclamation mark is immediately followed by the destination directory. The <B>usr/spool/uucppublic</B> directory is a common destination for UUCP sites.</P>
<P>Please be aware that none of the machine names in this chapter are real. Don’t use these specific examples on your own system.</P>
<P>Generically, the <B>uucp</B> command would look like this:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ uucp <I>sourcefile destinationfile</I>
</PRE>
<!-- END CODE SNIP //-->
<P>The <B>uucp</B> command can also be used to grab files from another machine, as long as you have the proper permissions (again, a configuration issue that we’ll duck). In this case, you’ll alter the <B>uucp</B> command line used earlier in this chapter. The principle is the same: use the <B>uucp</B> command to list the source file and then its destination. In this case, the remote file is the source file and a local directory is the destination:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ uucp spike!/usr/spool/uucppublic/chap9.txt\
/usr/spool/uucppublic
</PRE>
<!-- END CODE SNIP //-->
<P>When using the <B>uucp</B> command to download a file, all you need to do is specify the destination directory; the command assumes that the filename will remain the same and that the destination directory exists on your local machine.</P>
<H4 ALIGN="LEFT"><A NAME="Heading13"></A><FONT COLOR="#000077">Potential Problems with the Uucp Command</FONT></H4>
<P>As many frustrated users can attest to, the <B>uucp</B> command and the greater UUCP command set are not foolproof. Perhaps the greatest frustration is that the <B>uucp</B> command isn’t interactive, and there’s no way to monitor the status of a file transfer. You can tell <B>uucp</B> to send you a receipt via electronic mail when the file transfer is completed:</P>
<!-- CODE SNIP //-->
<PRE>
gilbert:/$ uucp -m chap9.txt spike!/usr/spool/uucppublic/chap9.txt
</PRE>
<!-- END CODE SNIP //-->
<P>However, if you don’t receive the electronic mail confirmation, you can assume that the transfer has failed. Finding out why, however, isn’t an easy task.
</P>
<P>It is made somewhat easier, however, by the presence of a <B>logfile</B> that <B>uucp</B> maintains as part of the transfer process. To get at this file, use the <B>uulog</B> command:</P>
<!-- CODE SNIP //-->
<PRE>
$ uulog
</PRE>
<!-- END CODE SNIP //-->
<P>This will provide a lot of output—probably too much for your troubleshooting purposes. It’s probably better if you combine the <B>uulog</B> with the name of a machine:</P>
<!-- CODE SNIP //-->
<PRE>
$ uulog -sspike
</PRE>
<!-- END CODE SNIP //-->
<P>Yes, -<I>sspike</I> is correct. In an oddity, the -<I>s</I> option to <B>uulog</B> must be immediately followed by the name of the machine (in this case, <I>spike</I>).</P>
<P>You’ll then need to read through the arcane information from uulog and try to make some sense of it. Successful file transfers will end with <I>REMOTE REQUESTED</I> or <I>OK</I>.</P>
<H4 ALIGN="LEFT"><A NAME="Heading14"></A><FONT COLOR="#000077">What Can Go Wrong?</FONT></H4>
<P>When a <B>uucp</B> connection fails, there are can be many potential culprits. The <B>uulog</B> command can be handy to discover that a connection was denied by the remote system (something like <I>ACCESS DENIED</I> will appear in the <B>logfile</B>). In this case, the login name or the password required by the remote machine may have been changed; this is a task for the system administrator to tackle.</P>
<P>If this isn’t the case and <I>ACCESS DENIED</I> still appears in the <B>logfile</B>, it could be a simple case of a mistyped command line. If you type the wrong filename or directory, the connection will succeed, but the transfer will fail. Again, by a careful read of the <B>logfile</B>, you can determine this.</P>
<P>Your transfer may also be the victim of your own impatience. Not all <B>uucp</B> requests are instantaneous; many system administrators choose to queue requests and make the transfers after hour, when longdistance rates are cheaper.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="420-423.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="427-430.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -