📄 mirror.html
字号:
<TD ALIGN=LEFT VALIGN=TOP>A non-batch transfer. Implied by <B><A HREF="#-g">-g</A></B>flag.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B><I>skip</I></B></TD><TD ALIGN=LEFT VALIGN=TOP><I>none</I></TD><TD ALIGN=LEFT VALIGN=TOP>If set causes this package to be skipped. The value is reported as the reason for skipping.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><B><I>verbose</I></B></TD><TD ALIGN=LEFT VALIGN=TOP><I>false</I></TD><TD ALIGN=LEFT VALIGN=TOP>Verbose messages.</TD></TR><TR VALIGN=TOP><TD ALIGN=LEFT VALIGN=TOP><A NAME="algorithm"></A><B><I>algorithm</I></B></TD><TD ALIGN=LEFT VALIGN=TOP><I>0</I></TD><TD ALIGN=LEFT VALIGN=TOP>Sets the basic algorithm that <B>mirror</B> uses. <P><B><I>Algorithm=0</I></B> mirrors an entire site at a time. Thisis very friendly on the remote site as it uses few of its resources. However it can chew up a lot of memory on the local machine. <P><B><I>Algorithm=1</I></B> mirrors a site directory-by-directory. Should <B>ONLY</B> be used for true mirrors (i.e.: no differences betweenthe this mirror copy and the original). This uses up a lot less local resources.However it is very unfriendly to the remote site as it requires remotesite to run an <B>ls</B> command for each directory mirrored. <B>Mirror</B> will only "see" the one directory it is mirroring so it willnot know that files outside this directory exists so symlinks outside thisdirectory are considered bad, see <A HREF="#make_bad_symlinks"><B><I>make_bad_symlinks</I></B>.</A> Deletions are done on a directory by directory basis so be extra carefulabout the settings of <A HREF="#max_delete_files">max_delete_files</A>and <A HREF="#max_delete_dirs">max_delete_dirs</A>. <B><I><A HREF="#get_patt">get_patt</A></I></B>is applied to just the filename in this directory not the full path, asare other name checks. You will almost certainly need to set <B><I><A HREF="#remote_dir">remote_dir</A></I></B>to be an absolute pathname (beginning with /). </TD></TR><TR VALIGN=TOP NOSAVE><TD ALIGN=LEFT VALIGN=TOP NOSAVE><B><I>local_dir_check</I></B></TD><TD ALIGN=LEFT VALIGN=TOP NOSAVE><I>false</I></TD><TD ALIGN=LEFT VALIGN=TOP NOSAVE>If true and the <B><I><A HREF="#local_dir">local_dir</A></I></B>does not exit skip this package. By default the <B><I><A HREF="#local_dir">local_dir</A></I></B>will be created if it does not already exist.</TD></TR><TR><TD></TD><TD></TD><TD></TD></TR></TABLE><H2><A NAME="Filestores"></A>Filestores</H2><B>Mirror</B> uses the remote directory listing to work out what filesare available. <B>Mirror</B> was originally targeted connect to Un*x FTPdaemons using a standard <B>ls</B> command. To use a Un*x host with a non-standard<B>ls</B> or a non Un*x host it is necessary to set the <B><I><A HREF="#remote_fs">remote_fs</A></I></B>variable to match the kind of directory listing that will be returned.There is some interaction between <B><I>remote_fs</I></B> and other variablesin particular <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B>,<B><I><A HREF="#recurse_hard">recurse_hard</A></I></B> and <B><I><A HREF="#get_size_change">get_size_change</A>.</I></B>The following sections show examples of the results of running the FTPDIR command on the various kinds of archive and recommendations for relatedvariables. With some unusual set-ups archive you may have to vary fromthe recommended variable set-ups.<H3><A NAME="remote_fs=unix"></A>remote_fs=unix</H3><PRE>total 65-rw-r--r-- 1 nobody nobody 2245 Jan 28 20:06 README-rw-r--r-- 1 nobody nobody 45881 Jan 29 19:13 mirror.html</PRE>This is the default and you should not normally have to reset any otherrelated variables.<H3><A NAME="remote_fs=dls"></A>remote_fs=dls</H3><PRE>00index.txt 189916 0readme 5793 1_x/ = OS/2 1.x-specific files</PRE>This is an <B>ls</B> variant used on some Un*x archives. It provides descriptionsof known items in the listing. Set <B><I><A HREF="#flags_recursive">flags_recursive</A></I></B>to -dtR.<H3><A NAME="remote_fs=netware"></A>remote_fs=netware</H3><PRE>- [R----F--] jrd 1646 May 07 21:43 indexd [R----F--] jrd 512 Sep 09 10:52 netwired [R----F--] jrd 512 Sep 02 01:31 pktdrvrd [RWCE-F--] jrd 512 Sep 04 10:55 incoming</PRE>or<PRE>-[R----F--] 1 jrd 1646 May 07 21:43 indexd[R----F--] 1 jrd 512 Sep 09 10:52 netwired[R----F--] 1 jrd 512 Sep 02 01:31 pktdrvr</PRE>This is used by Novell archives. Set <B><I><A HREF="#recurse_hard">recurse_hard</A></I></B>to true and set <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B>to be nothing. See also <B><I><A HREF="#remote_dir">remote_dir</A></I></B>.<H3><A NAME="remote_fs=dosftp"></A>remote_fs=dosftp</H3><PRE>00-index.txt 6,471 13:54 7/20/93 alabama.txt 1,246 23:29 5/08/97alaska.txt 873 23:29 5/08/92 alberta.txt 2,162 23:29 5/08/97</PRE>dosftp is for an FTP daemon on D*S boxes. Set <B><I><A HREF="#recurse_hard">recurse_hard</A></I></B>to true and set <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B>to nothing. See also <B><I><A HREF="#remote_dir">remote_dir</A></I></B>.<H3><A NAME="remote_fs=macos"></A>remote_fs=macos</H3><PRE>-------r-- 0 127 127 Aug 27 13:53 !Gopher Linksdrwxrwxr-x folder 32 Sep 9 16:30 FAQdrwxrwx-wx folder 0 Sep 9 09:59 incoming</PRE>macos is for one of Macintosh FTP daemon variants. Although the outputis similar to Un*x the Un*x <B><I>remote_fs</I></B> type cannot copewith it because there are three file sizes for each file. Set <B><I><A HREF="#recurse_hard">recurse_hard</A></I></B>to true, <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B>to nothing, <B><I><A HREF="#get_size_change">get_size_change</A></I></B>to false and <B><I><A HREF="#compress_patt">compress_patt</A></I></B> tonothing (this last setting is due to the unusual file names upsetting theshell used to run compress). See also <B><I><A HREF="#remote_dir">remote_dir</A></I></B>.<H3><A NAME="remote_fs=vms"></A>remote_fs=vms</H3><PRE>USERS:[ANONYMOUS.PUBLIC]1-README.FIRST;13 9 14-JUN-1993 13:09 [ANONYMOUS] (RWE,RWE,RE,RE)PALTER.DIR;1 1 18-JAN-1993 11:56 [ANONYMOUS] (RWE,RWE,RE,RE)PRESS-RELEASES.DIR;1 1 11-AUG-1992 20:05 [ANONYMOUS] (RWE,RWE,,)</PRE>alternatively:<PRE>[VMSSERV.FILES]ALARM.DIR;1 1/3 5-MAR-1993 18:09[VMSSERV.FILES]ALARM.TXT;1 1/3 4-FEB-1993 12:20</PRE>Set <B><I><A HREF="#flags_recursive">flags_recursive</A></I></B> to '[...]'and <B><I><A HREF="#get_size_change">get_size_change</A></I></B> to false.<B><I><A HREF="#recurse_hard">recurse_hard</A></I></B> is <B>not</B> availablewith VMS. See also the <B><I><A HREF="#vms_keep_versions">vms_keep_versions</A></I></B>and <B><I><A HREF="#vms_xfer_text">vms_xfer_text</A></I></B> variables.<BR> <H3><A NAME="remote_fs=infomac"></A>remote_fs=infomac</H3><PRE>-r 1974 Jul 21 00:06 00readme.txtlr 3 Sep 8 08:34 AntiVirus -> vir</PRE>This is a special case just meant to handle the sumex-aim.stanford.eduinfo-mac directory listing stored on that archive in help/all-files. <B><I><A HREF="#recurse_hard">recurse_hard</A></I></B>should be set to true.<H3><A NAME="remote_fs=dosish"></A>remote_fs=dosish</H3>This is for a D*S/Wind*ws FTP server with a faintly DOS like output<PRE>03-04-94 08:45PM <DIR> .03-04-94 08:45PM <DIR> ..03-04-94 09:58AM 9718 Conduit03-04-94 09:59AM 8745 Eve</PRE><B><I><A HREF="#recurse_hard">recurse_hard</A></I></B> should be set totrue and <B><I><A HREF="#flags_nonrecursive">flags_nonrecursive</A></I></B>to nothing.<H3><A NAME="remote_fs=lsparse"></A>remote_fs=lsparse</H3>Allow reparsing of the listing generated by <B>mirror</B> with debuggingturned to a high level. Meant only for <A HREF="mailto:lmjm@icparc.ic.ac.uk?SUBJECT=You Are A Wizard"><B>mirror</B>wizards</A>.<H2><A NAME="Examples"></A>Examples</H2>Here is the <A HREF="#Setting Defaults">mirror.defaults</A> file from thearchive on sunsite.org.uk:<PRE># This is the default mirror settings used by my site:# sunsite.org.uk (193.63.255.4)package=defaults # The LOCAL hostname - if not the same as `hostname` # (I advertise the name sunsite.org.uk but the machine is # really swallow.sunsite.org.uk) hostname=sunsite.org.uk # Keep all local_dirs relative to here local_dir=/public/Mirrors remote_password=wizards@sunsite.org.uk mail_to= # Don't mirror file modes. Set all dirs/files to these dir_mode=0755 file_mode=0444 # By default, files are owned by root.zero user=0 group=0# # Keep a log file in each updated directory# update_log=.mirror update_log= # Don't overwrite my mirror log with the remote one. # Don't retrieve any of their mirror temporary files. # Don't touch anything whose name begins with a space! # nor any FSP or gopher files... exclude_patt=(^|/)(\.mirror$|\.in\..*\.$|MIRROR.LOG|#.*#|\.FSP|\.cache|\.zipped|lost+found/|) # Try to compress everything compress_patt=. compress_prog=compress # Don't compress information files, files that don't benefit from # being compressed, files that tell ftpd, gopher, wais... to do things, # the sources for compression programs... # (Note this is the only regexp that is case insensitive.) compress_excl+|^\.notar$|-z|\.gz$|\.taz$|\.tar.Z|\.arc$|\.zip$|\.lzh$|\.zoo$|\.exe$|\.lha$|\.zom$|\.gif$|\.jpeg$|\.jpg$|\.mpeg$|\.au$|read.*me|index|\.message|info|faq|gzip|compress # Don't delete own mirror log or any .notar files (incl in subdirs) delete_excl=(^|/)\.(mirror|notar)$ # Ignore any local readme files local_ignore=README.doc.ic # Automatically delete local copies of files that the # remote site has zapped do_deletes=true</PRE>Here are some sample package descriptions:<PRE>package=gnu comment=Powerful and free Un*x utilities site=prep.ai.mit.edu remote_dir=/pub/gnu # Local_dir+ causes gnu to be appended to the default local_dir # so making /public/gnu local_dir+gnu exclude_patt+|^ListArchives/|^lost+found/|^scheme-7.0/|^\.history # I tend to only keep the latest couple of versions of things # this stops mirror from retrieving the older versions I've removed max_days=30 do_deletes=falsepackage=X11R6 comment=X Windows (windowing graphics system for Un*x) site=ftp.x.org remote_dir=/pub/R6 local_dir+ftp.x.org/pub/R6 # This is a local symlink to the free-for-all contrib area # and is mirrored elsewhere local_ignore=^contrib$ # Don't compress a thing. It is already compressed # but doesn't look it. compress_patt=# THIS IS JUST A TESTpackage=test vms site site=vmsbox.somewhere.ac.uk local_dir=/tmp/copy4 remote_dir=vmsserv/files remote_fs=vms # Must do these settings for VMS flags_recursive=[...] get_size_change=false# and on, and on ...</PRE><H2><A NAME="Temporary Filenames"></A>Temporary Filenames</H2>By default when mirror creates a temporary filename it takes the real filenameand puts <B><TT><FONT SIZE=+1>.in.</FONT></TT></B> at the start.<BR>If your system limits the length of a filename a lot (some older Un*xeswere limited to 14 characters) then look for:<PRE> <TT>LIMITED NAMELEN</TT></PRE>which is about 75% of the way through mirror.pl, for a note on how to reducetemporary filename length. I only know of one site using this.<H2><A NAME="Regular Expressions"></A>Regular Expressions</H2>This is a short explanation of regular expressions. For a more comprehensiveguide see the <B>Perl</B> manual pages or the O'Reilly book "MasteringRegular Expressions".<P>A regular expression, or regexp, is a way of using matching patternsin text strings. For example the regexp:<UL><PRE> ^s</PRE></UL>would match any string that begins with an <B><TT><FONT SIZE=+1>s</FONT></TT></B>. The <B><TT><FONT SIZE=+1>^</FONT></TT></B> is a special character thatmeans <I>beginning of string</I>. There are a number of specialspossible in a regexp, everything that is not special is taken as a literalcharacter, such as the <B><TT><FONT SIZE=+1>s</FONT></TT></B> in the exampleabove. To turn off a special character put a backslash, <B><TT><FONT SIZE=+1>\</FONT></TT></B>,in front of it. This only effects the special character immediatelyfollowing it.<P>A word of warning: although very similar to Un*x shell (and D*S COMMAND)wildcards there are differences. For example any Un*x and D*S wouldtreat *.ZIP as any filename ending in .ZIP, *.ZIP as a regular expressionis an error! The * is special that must follow something (see below).<H3>Regexp Specials</H3><TABLE><TR><TD>^</TD><TD>beginning of string</TD></TR><TR><TD>$</TD><TD>end of string</TD></TR><TR><TD>.</TD><TD>any character</TD></TR><TR><TD>[r]</TD><TD>a range or characters either as a list <I>abcef</I> or a hyphen separatedrange <I>a-f</I></TD></TR><TR><TD>[^r]</TD><TD>anything not in the given list or range</TD></TR><TR><TD>(p1|p2|p3...)</TD><TD>patterns p1 or p2 or p3 ... (the patterns may be specials)</TD></TR><TR><TD>*</TD><TD>zero or more of the preceding item (which may be a special)</TD></TR><TR><TD>+
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -