⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch44.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:
address, as long as each system you are connecting to allows the pass-through and



can connect to the next machine on the list. For example, the address<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">arthur!warlock!chatton!vader!alex



</FONT></PRE>



<P>would send data through <TT>arthur</TT>, <TT>warlock</TT>, <TT>chatton</TT>, and



<TT>vader</TT> in order, and then to the user <TT>alex</TT>. The addresses must be



specified in the proper hop order or the address will fail. This multihop addressing



can be very useful if a number of friends have local connections to other machines,



allowing you to easily set up a complex network. The hard part is usually tracking



the names of the systems involved. (The exclamation mark in the address is called



a bang, so the address above is spoken as &quot;arthur-bang-warlock-bang-chatton-bang-vader-bang-alex.&quot;)







<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading14<FONT COLOR="#000077"><B>NOTE: </B></FONT>Some shells don't



	like the bang character because they are interpreted as a special shell command.



	Shells, such as the C Shell, use the exclamation mark to recall previous commands,



	so you must escape the bang with a slash to prevent the shell's interpretation. Addresses



	then become <TT>arthur\!chatton\!yvonne</TT>. This looks funny, but you get used



	to it.



<HR>







</DL>







<P>Depending on how you have your UUCP system set, it may call out to the other systems



in an address whenever something is submitted to it, or if callout times are limited,



the data may be spooled until a call is allowed. You have already seen how to set



callout times in the <TT>/usr/lib/uucp/sys</TT> and <TT>/usr/lib/uucp/Systems</TT>



files.</P>







<P>A quick caution about relying on UUCP for delivery of information. If the systems



that are being used are not set to call immediately when there is something queued,



your data can take a long time to get to its destination. For example, if one of



the hops in your address calls the next machine in the address only once a day, you



may have a 24-hour delay in delivery. This can be exacerbated by each machine in



the network.







<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading15<FONT COLOR="#000077">CAUTION: </FONT>Don't rely on the contents



	of your data sent through UUCP to be kept confidential. Once on a remote system,



	any user with access privileges to the queue could snoop into your data. Ideally,



	the file permission prevents anyone but the superuser accessing the data, but not



	all systems keep tight security. If you must send sensitive data, encrypt it and



	let the recipient know the decryption key through another format (not in a mail message!).



<HR>







</DL>







<P>UUCP deals with all transfers as jobs, a term you'll encounter often when working



with UUCP and its documentation. A job is a command that is to be executed on the



remote system, a file that is to be transferred to or from the remote, or any other



task that you want performed between the two systems.



<CENTER>



<H4><A NAME="Heading16<FONT COLOR="#000077">Sending E-Mail with UUCP</FONT></H4>



</CENTER>



<P>Most utilities like mail packages understand the UUCP addresses, so you don't



have to worry about e-mail not reaching the proper destination. You don't usually



have to make any changes to applications running under Linux to get them to understand



this UUCP address format. In the last section you saw how the mail package can be



used with UUCP addresses.</P>



<P>You can use any of the usual <TT>mail</TT> command options to modify the behavior



of the package. For example, to send the contents of the file <TT>data_1</TT> to



<TT>yvonne</TT> on system <TT>chatton</TT> through the system <TT>arthur</TT>, and



tag the mail with a subject heading, you would issue this command:<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">mail -s &quot;Data file&quot; arthur\!chatton\!yvonne &lt; data_1



</FONT></PRE>



<P>Most mail packages available for Linux, including X-based mailers, work perfectly



well with UUCP addresses, as well as the more common Internet addresses, but you



may want to check before adopting a new mail package.



<CENTER>



<H4><A NAME="Heading17<FONT COLOR="#000077">Transferring Files with UUCP</FONT></H4>



</CENTER>



<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<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp [options] source destination



</FONT></PRE>



<P>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: 



<TABLE BORDER="0">



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="58" ALIGN="LEFT" VALIGN="TOP"><TT>-c</TT> </TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Do not copy the file to a spool directory before sending. The default action is to



			copy to a spool directory, and using the <TT>-c</TT> option explicitly specifies



			it



			<TABLE BORDER="0" WIDTH="310" HEIGHT="47">



				<TR ALIGN="LEFT">



					<TD ALIGN="LEFT"> </TD>



				</TR>



			</TABLE>



  </TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="58" ALIGN="LEFT" VALIGN="TOP"><TT>-f</TT> </TD>



		<TD ALIGN="LEFT" VALIGN="TOP">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.</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="58" ALIGN="LEFT" VALIGN="TOP"><TT>-m</TT> </TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Sends mail to the person who issued the <TT>uucp</TT> command when the copy is complete.



					</TD>



	</TR>



	<TR ALIGN="LEFT" rowspan="1">



		<TD WIDTH="58" ALIGN="LEFT" VALIGN="TOP"><TT>-n</TT> <TT>user<BR>



			</TT></TD>



		<TD ALIGN="LEFT" VALIGN="TOP">Sends mail to user on the remote system when the copy is complete.<BR>



					</TD>



	</TR>



</TABLE>



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>, you would use the following command:<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp data_1 arthur\!/usr/spool/uucppublic



</FONT></PRE>



<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 as you likely 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, you would issue



this command:<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp -m -nbill data_1 arthur\!/usr/spool/uucppublic/bill/



</FONT></PRE>



<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 command<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp chatton\!/usr/tmp/bigfile /usr/tparker/



</FONT></PRE>



<P>would 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>



<P>UUCP allows wildcards to be used, although you must escape 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,



you would issue the command<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp &quot;warlock!/usr/bill/book/chap*&quot; /usr/bigbook/



</FONT></PRE>



<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 could transfer files from one remote system to another by specifying



their names on the command line like this:<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uucp arthur\!/usr/lib/uucppublic/bigfile warlock\!/usr/lib/uucppublic/



</FONT></PRE>



<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.



<CENTER>



<H4><A NAME="Heading18<FONT COLOR="#000077">Checking on Transfers</FONT></H4>



</CENTER>



<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<FONT



COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">jobID system user date command size



</FONT></PRE>



<P>where 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 user name 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.</P>



<P>If you issue the command as a user (not superuser), only your jobs are listed.



The superuser 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:<FONT COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uustat -a



</FONT></PRE>



<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:<FONT



COLOR="#0066FF"></FONT>



<PRE><FONT COLOR="#0066FF">uustat -k 17



</FONT></PRE>



<P>You can only cancel your own jobs, unless you are logged in as superuser, in which



case you can cancel any jobs.



<CENTER>



<H3><A NAME="Heading19<FONT COLOR="#000077">Summary</FONT></H3>



</CENTER>



<P>UUCP is quite easy to set up, as long as you follow the rules. Once the configuration



files are properly set, UUCP offers an easy way to transfer e-mail, 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 e-mail



back and forth, and really making your Linux system feel like a well-connected workstation.



















</td>
</tr>
</table>

<!-- begin footer information -->



</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -