nnfs.html
来自「Non-Networked File System在几个非网络的(或慢网络的)U」· HTML 代码 · 共 1,569 行 · 第 1/2 页
HTML
1,569 行
CLASS="COMMAND">nnfs2</B> <TTCLASS="OPTION">--add-nickname</TT> <TTCLASS="REPLACEABLE"><I>hostname-yet-known-by-nnfs</I></TT></P></LI><LI><P>You answer: <BCLASS="KEYCAP">c</B> <BCLASS="KEYCAP">return</B> to continue the update</P></LI></UL></P></DIV><DIVCLASS="REFSECT2"><ANAME="AEN260"></A><H3>Configuration</H3><P>The configuration file is <TTCLASS="FILENAME">.nnfs/nnfsrc</TT>,it is created the first time you run <BCLASS="COMMAND">nnfs2</B>.It is a hugely commented shell script you can edit.It is a shell script to allow some default valuesto be computed from the system.</P><P>If you find this configuration file too complex to edit,you can use the <BCLASS="COMMAND">nnfs2</B> X11 interface to edit the file.There is many tips to help you configure.</P><P>The more useful options are :<P></P><UL><LI><P><TTCLASS="ENVAR">READ_MEDIUM</TT> shell script called by <BCLASS="COMMAND">nnfs2</B> to read from the medium</P></LI><LI><P><TTCLASS="ENVAR">WRITE_MEDIUM</TT> shell script called by <BCLASS="COMMAND">nnfs2</B> to write on the medium</P></LI><LI><P><TTCLASS="ENVAR">COMPRESS_FILTER</TT> shell script filter called by <BCLASS="COMMAND">nnfs2</B> to compress</P></LI><LI><P><TTCLASS="ENVAR">UNCOMPRESS_FILTER</TT> shell script filter called by <BCLASS="COMMAND">nnfs2</B> to uncompress</P></LI><LI><P><TTCLASS="ENVAR">MEDIUM_SIZE</TT> size of the medium in bytes</P></LI><LI><P><TTCLASS="ENVAR">OUTPUT_FILTER</TT> indicate which files should not be mirrored</P></LI><LI><P><TTCLASS="ENVAR">CONFIRMATION</TT> choose which questions <BCLASS="COMMAND">nnfs2</B> will ask you</P></LI><LI><P><TTCLASS="ENVAR">AUTO_START</TT> if true, <BCLASS="COMMAND">nnfs2</B> X11 interface start update without user intervantion.</P></LI><LI><P><TTCLASS="ENVAR">TMP_FILE</TT> set this to <TTCLASS="LITERAL">none</TT> if you use <BCLASS="COMMAND">nnfs2</B> with a big medium</P></LI><LI><P><TTCLASS="ENVAR">CROSS_MOUNT_POINT</TT> if true <BCLASS="COMMAND">nnfs2</B> will synchronise all the files even if they are on several file systems. The default is false so the mount points are not crossed.</P></LI><LI><P><TTCLASS="ENVAR">COPY_HARD_LINK</TT> if true <BCLASS="COMMAND">nnfs2</B> will copy hard links as several files not hard linked, this is dangerous because an update can break the link, so the default is false and the hard linked files are not copied at all.</P></LI></UL></P><P>The option hard to configure is <TTCLASS="ENVAR">OUTPUT_FILTER</TT>.The default value is fine for me but certainly not for you.The minimal filter must stop the copy of <BCLASS="COMMAND">nnfs2</B> history and all backup files.</P><DIVCLASS="EXAMPLE"><ANAME="AEN315"><P><B>Example 3. Required minimal filter</B></P><PRECLASS="SCREEN">-regex=~$-regex=^\.nnfs/history/</PRE></DIV><P>But, to run <BCLASS="COMMAND">nnfs2</B> you must be connected, and the connectionmodify some file you don't want to copy on other hostsbecause it is a security breach or it is a non-sense.For example, any dot file in connection directoryending by <TTCLASS="LITERAL">history</TT> or <TTCLASS="LITERAL">authority</TT> </P><DIVCLASS="EXAMPLE"><ANAME="AEN322"><P><B>Example 4. Filter files modified by the connection</B></P><PRECLASS="SCREEN">-regex=^\.[^/]*(history|authority)$</PRE></DIV><P>If the medium is small, you need to filter the files that aregarbage as <TTCLASS="LITERAL">core</TT>, the executable filesor the results of compilation as <TTCLASS="LITERAL">.o</TT> files.I assume here that executables biggers than 50k are not scriptsshell or perl.</P><DIVCLASS="EXAMPLE"><ANAME="AEN328"><P><B>Example 5. Filter garbage files</B></P><PRECLASS="SCREEN">-type=f size=+50k perm=+111-regex=(\.(o|a|so|sl|aux|log|dvi|summary|old)|/(core|a\.out))$</PRE></DIV><P>The big shell or perl script are filtered, if you don't wantthis. Tell <BCLASS="COMMAND">nnfs2</B> to not filter them.</P><DIVCLASS="EXAMPLE"><ANAME="AEN333"><P><B>Example 6. Do not filter scripts</B></P><PRECLASS="SCREEN">+regex=\.(pl|sh|tcl)$+regex=/configure$</PRE></DIV><DIVCLASS="REFSECT3"><ANAME="AEN336"></A><H4>Reference of the filter description</H4><P>Each line starts by <TTCLASS="LITERAL">-</TT> or <TTCLASS="LITERAL">+</TT>,to remove or add to the file set the files verifying all the conditionsin the line.</P><P>The conditions are:<P></P><UL><LI><P><TTCLASS="LITERAL">perm=+</TT><TTCLASS="REPLACEABLE"><I>xxx</I></TT>:The condition is verified if any bit indicated in octal are in thefile mode. If you indicate <TTCLASS="LITERAL">0111</TT> the file mode <TTCLASS="LITERAL">0100</TT>, <TTCLASS="LITERAL">0111</TT>, <TTCLASS="LITERAL">0750</TT> areverified.</P></LI><LI><P><TTCLASS="LITERAL">perm=-</TT><TTCLASS="REPLACEABLE"><I>xxx</I></TT>:The condition is verified if all the bits indicated in octal are inthe file mode. If you indicate <TTCLASS="LITERAL">0111</TT> the file mode <TTCLASS="LITERAL">0755</TT> is verified butnot <TTCLASS="LITERAL">0750</TT>.</P></LI><LI><P><TTCLASS="LITERAL">perm=</TT><TTCLASS="REPLACEABLE"><I>xxx</I></TT>:The condition is verified if the file mode is exactly equal to thevalue indicated in octal.</P></LI><LI><P><TTCLASS="LITERAL">size=+</TT><TTCLASS="REPLACEABLE"><I>xxx</I></TT>:The condition is verified if the file size if bigger than the sizespecified. A size in kilo-bytes may be specified as<TTCLASS="LITERAL">56k</TT> and in mega-bytes as <TTCLASS="LITERAL">2m</TT></P></LI><LI><P><TTCLASS="LITERAL">size=-</TT><TTCLASS="REPLACEABLE"><I>xxx</I></TT>:same as above, but the file size must be smaller. The two conditionsmay appear on the same line.</P></LI><LI><P><TTCLASS="LITERAL">type=</TT><TTCLASS="REPLACEABLE"><I>dflp</I></TT>:The type is regular file (<TTCLASS="LITERAL">f</TT>), directory(<TTCLASS="LITERAL">d</TT>), FIFO (<TTCLASS="LITERAL">p</TT>) or symbolic link (<TTCLASS="LITERAL">l</TT>)</P></LI><LI><P><TTCLASS="LITERAL">regex=</TT><TTCLASS="REPLACEABLE"><I>aregularexpression</I></TT>: If you want the expression to match the full name, add <TTCLASS="LITERAL">^</TT> at the begin and <TTCLASS="LITERAL">$</TT> at the end.This condition must be at the end of the line.</P></LI></UL></P></DIV></DIV><DIVCLASS="REFSECT2"><ANAME="AEN386"></A><H3>Synchronisation of <SPANCLASS="ACRONYM">UID</SPAN> and <SPANCLASS="ACRONYM">GID</SPAN></H3><P>If you want to synchonise the files with there <SPANCLASS="ACRONYM">UID</SPAN>and <SPANCLASS="ACRONYM">GID</SPAN> you need to be <TTCLASS="LITERAL">root</TT> and to runthe <BCLASS="COMMAND">rootnnfs2</B>.</P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN395"></A><H2>FILES</H2><P></P><DIVCLASS="VARIABLELIST"><DL><DT><TTCLASS="FILENAME">~/.nnfs/nnfsrc</TT></DT><DD><P><BCLASS="COMMAND">nnfs2</B> configuration</P></DD><DT><TTCLASS="FILENAME">~/.nnfs/gtkrc</TT></DT><DD><P><BCLASS="COMMAND">nnfs2</B> GTK configuration</P></DD><DT><TTCLASS="FILENAME">~/.nnfs/history</TT></DT><DD><P>Directory where modified or deleted files are saved</P></DD><DT><TTCLASS="FILENAME">~/.nnfs/log~</TT></DT><DD><P>Some log about <BCLASS="COMMAND">nnfs2</B> last work</P></DD></DL></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN421"></A><H2>BUGS</H2><P>Limitations:<P></P><UL><LI><P>Directories must contains less than 65536 files (need to recompile).</P></LI><LI><P>Less than 16 hosts to synchronise (need to recompile).</P></LI><LI><P>No mirroring of 000 mode file (it is more a feature than a bug).</P></LI><LI><P>No mirroring of hard links (will not be corrected).</P></LI><LI><P>A file may be not mirrored if it is modified in the same second that <BCLASS="COMMAND">nnfs2</B> modify it (will not be corrected).</P></LI><LI><P>If A, B and C are 3 hosts, B filter some files. <BCLASS="COMMAND">nnfs2</B> runs on A, B, C, A, B, C, A, B, C, A, B, C, ... The modified files on A are filtered by B and are not copied on C.(very difficult to correct)</P></LI><LI><P>When adding an host to <BCLASS="COMMAND">nnfs2</B>, symbolics links are copied becausethe <SPANCLASS="emphasis"><ICLASS="EMPHASIS">NNFS medium</I></SPAN> doesn't contain the content of the link.The real problem is that you can't create a symbolic linkwith all the good attributes (modification time, mode and on some systems <SPANCLASS="ACRONYM">UID</SPAN>and <SPANCLASS="ACRONYM">GID</SPAN>). So it is impossible to fully mirror symbolic links</P></LI><LI><P>In <TTCLASS="FILENAME">g_file.h</TT> should use <TTCLASS="LITERAL">off_t</TT> in place of <TTCLASS="LITERAL">long</TT> but it doesn't compile on IRIX MIPS IP30 gcc. So files are limited to 2GB.</P></LI><LI><P> On Mac OS X the symbolic links are often copied because thefile system does not store modification dateof symbolic links.</P></LI><LI><P> On Mac OS X is <BCLASS="COMMAND">nnfs2</B> is unpredictable if only the case is different between two file names as with <TTCLASS="LITERAL">README</TT> and <TTCLASS="LITERAL">Readme</TT></P></LI></UL></P><P>Bugs:<P></P><UL><LI><P> In some cases, the GTK progress bar go over 100%.</P></LI></UL></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN461"></A><H2>NO WARRANTY</H2><P><SPANCLASS="emphasis"><ICLASS="EMPHASIS">This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.</I></SPAN></P><P>It is nearly impossible that <BCLASS="COMMAND">nnfs2</B> do an irrecoverable error.In the worst case, <BCLASS="COMMAND">nnfs2</B> will stop.The returned value (error) of all the system calls are verified andthe program tries to analyse the error.</P><P>The parameters of the more stressing test on <BCLASS="COMMAND">nnfs2</B> are the following:<P></P><UL><LI><P> 4 hosts</P></LI><LI><P> On each host a program create/delete/modify file/links/directories at the maximum speed.</P></LI><LI><P><BCLASS="COMMAND">nnfs2</B> runs continuously on each of the host randomly. So, while <BCLASS="COMMAND">nnfs2</B> runs, files are modified while it is reading/writing them. Or worstly, directories are deleted while <BCLASS="COMMAND">nnfs2</B> analyse the content, or files are created in directories that <BCLASS="COMMAND">nnfs2</B> tries to delete</P></LI></UL>Incredibly, <BCLASS="COMMAND">nnfs2</B> works in this case thousands of timeon a Linux 386 Debian host.</P><P><BCLASS="COMMAND">nnfs2</B> had been compiled and tested on HPPA 1.1 HPUX 10.20 and MIPS IP30 IRIX 6.5</P><P>On Mac OS X it does not work optimaly with symbolic links (see BUGS).</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN485"></A><H2>SEE ALSO</H2><P></P><TABLEBORDER="0"><TBODY><TR><TD><SPANCLASS="CITEREFENTRY"><SPANCLASS="REFENTRYTITLE"><BCLASS="COMMAND">gzip</B></SPAN>(1)</SPAN></TD></TR><TR><TD><SPANCLASS="CITEREFENTRY"><SPANCLASS="REFENTRYTITLE"><BCLASS="COMMAND">mcopy</B></SPAN>(1)</SPAN></TD></TR></TBODY></TABLE><P></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN498"></A><H2>AUTHOR</H2><P>Author: Thierry EXCOFFIER,Author Home Page:<AHREF="http://www710.univ-lyon1.fr/~exco"TARGET="_top">http://www710.univ-lyon1.fr/~exco</A></P><P><BCLASS="COMMAND">nnfs2</B> home page: <AHREF="http://www710.univ-lyon1.fr/~exco/nnfs.html"TARGET="_top">http://www710.univ-lyon1.fr/~exco/nnfs.html</A> </P></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?