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

📄 mirror.html

📁 站点映像程序
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<HTML><HEAD>   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">   <META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; Linux 2.0.32 i686) [Netscape]">   <META NAME="Author" CONTENT="Lee McLoughlin and Zoe Leech">   <TITLE>Mirror 2.9 Reference Manual</TITLE><!--  Copyright (C) 1990 - 1997   Lee McLoughlin   Permission to use, copy, and distribute this software and its  documentation for any purpose with or without fee is hereby granted,  provided that the above copyright notice appear in all copies and  that both that copyright notice and this permission notice appear  in supporting documentation.   Permission to modify the software is granted, but not the right to  distribute the modified code.  Modifications are to be distributed  as patches to released version.   This software is provided "as is" without express or implied warranty.   $Id: mirror.html,v 2.9 1998/05/29 19:03:01 lmjm Exp lmjm $  $Log: mirror.html,v $  Revision 2.9  1998/05/29 19:03:01  lmjm  *** empty log message ***--></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000"><CENTER><H1>Mirror 2.9 Reference Manual</H1></CENTER><CENTER><H1><I>Lee McLoughlin</I></H1></CENTER><CENTER><I><FONT SIZE=+0>and</FONT></I></CENTER><CENTER><H1><I><FONT SIZE=+3>Zo&euml; Leech</FONT></I></H1></CENTER><CENTER>1 June 1998</CENTER><CENTER><TT><A HREF="mailto:lmjm@icparc.ic.ac.uk">lmjm@icparc.ic.ac.uk</A></TT></CENTER><CENTER><TT><A HREF="zl@icparc.ic.ac.uk">zl@icparc.ic.ac.uk</A></TT></CENTER><UL><LI><A HREF="#Introduction">Introduction</A></LI><LI><A HREF="#Description">Description</A></LI><LI><A HREF="#Flags">Flags</A></LI><LI><A HREF="#Package Files">Package Files</A></LI><UL><LI><A HREF="#Keywords">Keywords</A></LI></UL><LI><A HREF="#Filestores">Filestores</A></LI><LI><A HREF="#Examples">Examples</A></LI><LI><A HREF="#Temporary Filenames">Temporary Filenames</A></LI><LI><A HREF="#Regular Expressions">Regular Expressions</A></LI><LI><A HREF="#Hints">Hints</A></LI><LI><A HREF="#Netiquette">Netiquette</A></LI><LI><A HREF="#Bugs">Bugs</A></LI><LI><A HREF="#Remember!">Remember!</A></LI><LI><A HREF="#Author">Author</A></LI></UL><H2><A NAME="Introduction"></A>Introduction</H2><B>Mirror</B> is a package written in <B><A HREF="http://www.perl.com/">Perl</A></B>that uses the FTP<A HREF="http://sunsite.org.uk/rfc/rfc959.txt"> protocol</A>to duplicate a directory hierarchy between the machine it is run onand a remote host. It avoids copying files unnecessarily by comparing thefile time-stamps and file sizes before transferring. Amongst other things,it can optionally rename, compress, gzip, and split files.<P><B>Mirror</B> was written by <A HREF="http://sunsite.org.uk/~lmjm/">LeeMcLoughlin</A> &lt;<A HREF="mailto:lmjm@icparc.ic.ac.uk">lmjm@icparc.ic.ac.uk</A>>for use by archive maintainers but can be used by anyone wanting to transfera lot of files via FTP.&nbsp; Although originally only available on Un*xwith version 2.9 <B>mirror</B> will also run on Wind*ws 95 and Wind*wsNT.<BR>&nbsp;<P>The latest version of <B>mirror</B> can always be found at either:<UL><TT><FONT SIZE=+1><A HREF="ftp://sunsite.org.uk/packages/mirror/mirror.tar.gz">ftp://sunsite.org.uk/packages/mirror/mirror.tar.gz</A></FONT></TT><BR><TT><FONT SIZE=+1><A HREF="ftp://sunsite.org.uk/packages/mirror/mirror.zip">ftp://sunsite.org.uk/packages/mirror/mirror.zip</A></FONT></TT></UL>The latest version of this guide can always be found at:<UL><TT><FONT SIZE=+1><A HREF="http://sunsite.org.uk/packages/mirror/mirror-guide.html">http://sunsite.org.uk/packages/mirror/</A></FONT></TT></UL><H2><A NAME="Description"></A>Description</H2><B>Mirror</B> is called in one of two ways (see also mirror master):<UL><PRE><TT><FONT SIZE=+1>mirror [flags] <A HREF="#-g">-g</A>site:pathname</FONT></TT></PRE><PRE><TT><FONT SIZE=+1>mirror [flags] [<A HREF="#Package Files">package-files</A>]</FONT></TT></PRE></UL>The first method is used to retrieve a remote file or directory into thecurrent directory. If you are mirroring a directory it is best to end thepathname in a slash ('/') as this makes the remote recursive listing smalleror use the <B><A HREF="#-r">-r</A></B> flag to suppress recursion (see<B><A HREF="#-g">-g</A></B> below). The <B><A HREF="#Setting Defaults">mirror.defaults</A></B>file is not used.<P>In the second method given above, a minimal number of arguments arerequired and <B>mirror</B> is controlled by <B><I><A HREF="#Keywords">keyword=value</A></I></B>lines read from the package files.&nbsp;<A NAME="Finding Defaults"></A>Ifa file named <B><A HREF="#Setting Defaults">mirror.defaults</A></B> isfound in either the directory containing the <B>mirror</B> executable orin the <B>PERLLIB</B> path, then it is loaded before any of the <TT><FONT SIZE=+1>package-files</FONT></TT>.&nbsp;<B><A HREF="#Setting Defaults">mirror.defaults</A></B> normally just contains&nbsp;the package of keyword settings called <B><I><A HREF="#Setting Defaults">defaults</A></I></B>that is used to provide common defaults for all <TT><FONT SIZE=+1>package-files</FONT></TT>.&nbsp;&nbsp;If no <B><A HREF="#Setting Defaults">mirror.defaults</A></B> file is found&nbsp;the <A HREF="#Keywords">default settings</A> built into <B>mirror&nbsp;</B>are used.<P>Each <TT><FONT SIZE=+1><A HREF="#Package Files">package-files</A></FONT></TT>is read in turn, looking for named <A HREF="#Package Files">packages</A>.&nbsp;If the package is not named <B><I><A HREF="#Setting Defaults">defaults</A></I>,</B>then <B>mirror</B> will perform the following steps.<P>If <B>mirror</B> is already connected to a site, other than the targetsite, it will disconnect from the site.&nbsp; It then changes to the givenlocal directory, creating it if necessary, and scans it to get the detailsof the local files that are already there.&nbsp; <B>Mirror</B> then attemptsto connect to the remote site's FTP daemon. It will then login using thegiven <B><I><A HREF="#remote_user">remote_user</A></I></B> and <B><I><A HREF="#remote_password">remote_password</A></I></B>.&nbsp;The remote directory is then scanned. <B>Mirror</B> does this by changingto the remote directory (<B><I><A HREF="#remote_dir">remote_dir</A></I></B>)and running the FTP LIST command, passing the <B><I><A HREF="#flags_recursive">flags_recursive</A></I></B>&nbsp;or <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B> optionsdepending on the value of <B><I><A HREF="#recursive">recursive</A></I></B>.&nbsp;Alternatively a file containing the directory listing may be retrieved(see <B><I><A HREF="#ls_lR_file">ls_lR_file</A></I></B> and <B><I><A HREF="#local_ls_lR_file">local_ls_lR_file</A></I></B>). Each remote pathname will have any required mappings performed on itto create a local pathname. Then any checks specified by the <I><B><A HREF="#exclude_patt">exclude_patt</A></B>,</I><B><I><A HREF="#max_days">max_days</A></I></B>, <B><I><A HREF="#get_newer">get_newer</A></I></B>and <B><I><A HREF="#get_size_change">get_size_change</A> </I></B>keywordsare applied to names of files or symlinks. <B><I><A HREF="#max_days">max_days</A></I></B>,<B><I><A HREF="#get_newer">get_newer</A></I></B> and <B><I><A HREF="#get_size_change">get_size_change</A>&nbsp;</I></B>are not applied to directories.&nbsp; This creates a list of allrequired remote files and the local pathnames to store them in.<P>Local versions of all required directories are then created.&nbsp; Thenall required files are fetched from the remote site into their local pathnames.This is done by retrieving the file into a <A HREF="#Temporary Filenames">temporaryfile</A> in the target directory. The transfer is normally done in binarymode (see <B><I><A HREF="#vms_xfer_text">vms_xfer_text</A></I></B>).&nbsp;If required the temporary file may be <A HREF="#File Compression">compressed,gzip'ed</A> or <A HREF="#File Splitting">split</A>. The file's time-stampsare reset to match those of the remote file.&nbsp; Finally the temporaryfile is renamed to have the correct name.<P>Once all files have been transferred any required symbolic links arecreated (where support by your Operating System) and any unnecessary pathnamesin the mirror are <A HREF="#File Deletion">deleted</A>.<P>Unless an internal failure is detected, any error will cause the currentpackage to be skipped and the next one tried.<P><B>Mirror</B> can handle symbolic links but not hard links. It doesnot duplicate owner or group information as usually this is meaninglessover a network (but see <B><I><A HREF="#user">user</A></I></B> and <B><I><A HREF="#group">group</A></I></B>).If you require any of these options and you are on Un*x use <B>rdist(1)</B>instead.<P><B>Mirror</B> was written to mirror remote Un*x archives, but has grown(like topsy).<H2><A NAME="Flags"></A>Flags</H2>Although <B>mirror</B> has a large number of command line flags most shouldonly really be used when doing a very simple mirror as a one-time event.&nbsp;If you intend to maintain a mirror area it is much better to put all thedetails into a <B>mirror</B> <A HREF="#Package Files">package</A> fileand then run <B>mirror</B> on that file.<P>The only flags you should use often are <B><A HREF="#-n">-n</A></B>and, if you like to see what mirror is up to,<B><A HREF="#-d">-d</A></B>.<BR>&nbsp;<TABLE><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-d"></A><B>-d&nbsp;</B></TD><TD ALIGN=LEFT VALIGN=TOP>Enable debugging. If this argument is given morethan once (e.g. -d -d) the debugging level will increase. Currently themaximum useful level is four.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-n"></A><B>-n</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Do nothing except compare local and remote directories,no file transfers are done. Sets debug level to two, so that you are showna trace of what would be done.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-g"></A><B>-g site:path</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Get all files&nbsp; matching path, which is a<A HREF="#Regular Expressions">regexp</A>, on the given site. If path matches.*/.+ (e.g. /fred or /fred/bloggs) then it is the name of the directoryand everything after the last / is the pattern of filenames to get. Ifpath ends with / then it is the name of a directory and all its contentsare retrieved.&nbsp; One note of caution. If you use host:/fred, a fulldirectory listing of / on the remote host will be done. If all you wantedwas the contents of the directory /fred then specify host:/fred/</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-p"></A><B>-p package</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>When using multiple <A HREF="#Package Files">packagefiles </A>only mirror the given package. This option may be given multipletimes in which case all the given packages will be mirrored. Without thisoption, all packages will be mirrored. Package is a <A HREF="#Regular Expressions">regexp</A>matched against the package name following the -p.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-R package</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Similar to <B><A HREF="#-p">-p</A></B> but skipsall packages until it reaches the given package. Useful for restartingfailed <B>mirror</B> runs from where they left off.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-F</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Use temporary <B>dbm</B> files for the informationabout files. This is useful if you mirror a very large directory.&nbsp;See the variable <B><I><A HREF="#use_files">use_files</A>.</I></B></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-r"></A><B>-r</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B>-k <I><A HREF="#recursive">recursive</A></I>=false</B></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-v</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Print the version details of <B>mirror</B> andexit.<A NAME="-T"></A></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-T</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Do not do any file transfers just force the time-stampsof any local files to be reset to be the same as the remote files. Normallyonly used when initialising a mirror that already contains files retrievedanother way (e.g. from CDROM).</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-Ufilename</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Record all files transfered by mirror into thegiven filename. Remember that <B>mirror</B> changes into <I><A HREF="#local_dir">local_dir</A></I>to do its work, so it should be a full pathname. If no filename is given,it defaults to <TT><FONT SIZE=+1>upload_log.day.month.year</FONT></TT>.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="-k"></A><B>-k <I>key</I>=value</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Override any default key/value.&nbsp; See below</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-m</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B><A HREF="#-k">-k</A> <I><A HREF="#mode_copy">mode_copy</A></I>=true</B>&nbsp;</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-t</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B><A HREF="#-k">-k</A> <I><A HREF="#text_mode">text_mode</A></I>=true</B></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-f</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B><A HREF="#-k">-k</A> <I><A HREF="#force">force</A></I>=true</B></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-s site</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B><A HREF="#-k">-k</A> <I><A HREF="#site">site</A></I>=site</B></TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-u user</B>&nbsp;</TD><TD ALIGN=LEFT VALIGN=TOP>Equivalent to <B><A HREF="#-k">-k</A> <I><A HREF="#remote_user">remote_user</A></I>=user</B>You are then prompted for a password, with echo turned off. The passwordis used as the <B><I><A HREF="#remote_password">remote_password</A></I></B>.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B>-L</B></TD><TD ALIGN=LEFT VALIGN=TOP>Just generate a pretty printed version of theinput and exit.</TD></TR></TABLE>

⌨️ 快捷键说明

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