📄 unx43.htm
字号:
<BR></P>
<P>So if I want to copy a file, data, but might change it later, and I am not worried about speed, I might try this:
<BR></P>
<PRE>uucp -r -C -gz data remote!data</PRE>
<P>If I also want to know when it is done and want to send mail to my friend Joe at the remote machine, I'd expand it to this:
<BR></P>
<PRE>uucp -r -C -gz -m -njoe data remote!data</PRE>
<P>That's an ugly command, to say the least!
<BR></P>
<P>uux is another command frequently used to execute remote programs. Most remote sites restrict this command, but imagine that you are on a very friendly network. At minimum, you need a command string, which is just a machine name followed by an
exclamation point and a command. The command is the same as a command typed on the system in the uucppublic directory. At minimum, you need this:
<BR></P>
<PRE>uux remote!date</PRE>
<P>That will run the date command on the remote system. Standard output is sent back to you. Assume that you want to put a message on your friend Joe's screen. If you were on the system, you'd use the command write joe and type something in. What you've
typed in is standard input, but you can't type on Joe's machine. uux will accept standard input on your screen, if we include the - on the command line. So you'd type this:
<BR></P>
<PRE>uux - remote!write joe</PRE>
<P>Then you'd enter your message. Note that you don't need to quote the command because anything after the command is considered an argument.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="note.gif" WIDTH = 35 HEIGHT = 35><B>NOTE:</B> Filenames for uux commands can be machine specified, as well. uux will attempt to get all the files needed to the remote machine before executing the command there.
<BR></NOTE>
<HR ALIGN=CENTER>
<P>uux also takes some other arguments. The -b option tells uux to return the standard input if the remote execution failed. Files may be copied to the spool with -C, and -j controls the ID string. The -n option tells uux not to return any indication of
success or failure by mail. By default, uux will send mail to the originator, letting that person know whether the command worked. Standard input can also be used with -p, and -r doesn't immediately start uucico. The grade can be set with -g, and -x
controls debugging. The originator name can be altered with -a.
<BR></P>
<H4 ALIGN="CENTER">
<CENTER><A ID="I29" NAME="I29">
<FONT SIZE=3><B>uuto and uupick</B>
<BR></FONT></A></CENTER></H4>
<P>These commands are complicated and can baffle the novice user. Fortunately, UNIX provides two friendlier commands, uuto and uupick, for transferring files. These two commands work together. The syntax for uuto is simple:
<BR></P>
<PRE>uuto file file file machine!user</PRE>
<P>Any number of files can be listed on the line—they'll all be transferred to the remote machine using uucp. Note that a user on the remote machine must be specified. This way, the file is placed in a directory on the remote machine identified by the
user's name. Only two arguments are accepted for uuto: -m says to send mail to the originator when the transfer is complete, and -p says to copy the file to the spool before transmission. In the case of transferring a file to my friend Joe, I'd set up this
command:
<BR></P>
<PRE>uuto -m file1 remote!joe</PRE>
<P>This is all I need to do. The uuto command will convert it to this:
<BR></P>
<PRE>uucp -d -m -njoe file1 remote!~/receive/joe/duke</PRE>
<P>The remote machine will then have a directory hierarchy for my friend Joe, under the receive directory, and with a subdirectory duke. A short time later, I'll get some e-mail that says (SYSTEM remote) copy succeeded and I will find a reference to the
file in the header.
<BR></P>
<P>On the other machine, Joe will also receive some e-mail, saying /usr/spool/uucppublic/receive/james/duke/file1 from duke!james arrived, which lets him know that he has a file in the uucppublic directory.
<BR></P>
<P>Getting that file is easy using uupick. This is another shell script that searches the public directory for files under your name in a receive directory. If it finds any files, it prompts you for what you want to do. The actions are fairly
straightforward:
<BR></P>
<TABLE BORDER>
<TR>
<TD>
<PRE>
<BR>New line:
<BR></PRE>
<TD>
<PRE>
<BR>Go to the next entry
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>d
<BR></PRE>
<TD>
<PRE>
<BR>Delete the file
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>m [dir]
<BR></PRE>
<TD>
<PRE>
<BR>Move the file to a directory dir
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>a [dir]
<BR></PRE>
<TD>
<PRE>
<BR>Move all files from the present system to a directory
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>p
<BR></PRE>
<TD>
<PRE>
<BR>Print the file
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>q
<BR></PRE>
<TD>
<PRE>
<BR>Quit
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>Control+D
<BR></PRE>
<TD>
<PRE>
<BR>Quit
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>!command
<BR></PRE>
<TD>
<PRE>
<BR>Run the command
<BR></PRE>
<TR>
<TD>
<PRE>
<BR>*
<BR></PRE>
<TD>
<PRE>
<BR>Print the command summary</PRE></TABLE>
<P>So if you enter uupick, Joe will be prompted with this:
<BR></P>
<PRE>from system duke: file file1 ?</PRE>
<P>If he types m, the file is placed in his current directory, and the transfer is complete.
<BR></P>
<HR ALIGN=CENTER>
<NOTE>
<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP: </B>With uuto and uupick, the user is completely removed from the messy details of uucp. Furthermore, on many systems uuto and uupick are all most users need to know.
<BR></NOTE>
<HR ALIGN=CENTER>
<H3 ALIGN="CENTER">
<CENTER><A ID="I30" NAME="I30">
<FONT SIZE=4><B>UUCP Utilities</B>
<BR></FONT></A></CENTER></H3>
<P>There are two notable UUCP utilities available to the user. One examines log files, the other provides transfer status information.
<BR></P>
<P>UUCP keeps some very detailed log files in /var/spool/uucp/.Log. The uulog command is designed to access the two busiest of those logs. It always takes a system name as an argument. By default, or with the -s flag, it will display the transfer
information for a given system. Here is a sample:
<BR></P>
<PRE>uucp remote (5/14-19:18:42,9604,0) CONN FAILED (CALLER SCRIPT FAILED)
uucp remote (5/14-19:48:40,9792,0) SUCCEEDED (call to remote )
uucp remote (5/14-19:48:43,9792,0) OK (startup)
uucp remote (5/14-19:48:44,9792,0) REMOTE REQUESTED (remote!D.netco56c3c71\
<BR> —> duke!D.netco56c3c71 (netnews))
uucp remote (5/14-19:48:55,9792,1) REMOTE REQUESTED (remote!D.duke4f4de04\
<BR> —> duke!X.netcomsd56c3 (netnews))
uucp remote (5/14-19:48:57,9792,2) REMOTE REQUESTED (remote!D.netcobeb02bd\
<BR> —> duke!D.netcobeb02bd (netnews))
uucp remote (5/14-19:49:14,9792,3) REMOTE REQUESTED (remote!D.duke4f4e043\
<BR> —> duke!X.netcomsdbeb0 (netnews))
uucp remote (5/14-19:49:17,9792,4) OK (conversation complete ttya 136)
uucp remote (5/14-20:18:41,9972,0) FAILED (LOGIN FAILED)
uucp remote (5/14-20:18:41,9972,0) CONN FAILED (CALLER SCRIPT FAILED)</PRE>
<P>From this log you can see that a connection failed at 7:18 PM, succeeded at 7:48, and failed again at 8:18. Normally this file would be fairly long, but I used the -N option to cut it to the last 10 lines of the file. If I wanted to wait on the file, I
could have used -f. This is the same flag as for tail.
<BR></P>
<P>The only other option is -x. It gives details of the commands executed on the local system from UUCP. An example of the output (again, truncated to just the last 10 lines) is this:
<BR></P>
<PRE>uucp remote duked4f46 (5/14-17:32:37,9158,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f43 (5/14-17:32:38,9158,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f47 (5/14-17:52:08,9225,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f48 (5/14-18:32:49,9287,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f49 (5/14-18:32:50,9287,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f4a (5/14-18:32:51,9287,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f4b (5/14-18:32:52,9287,0) remote!remote!uucp-bounce XQT\
<BR> (PATH=/bin:/usr/bin USER=uucp UU_MACHINE=remote UU_USER=remote!uucp-bounce\
<BR> export UU_MACHINE UU_USER PATH; rnews )
uucp remote duked4f4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -