<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>supersun&apos;s space</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/" />
    <link rel="self" type="application/atom+xml" href="http://supersun.biz/atom.xml" />
    <id>tag:supersun.biz,2008-11-03://8</id>
    <updated>2009-01-06T06:51:06Z</updated>
    <subtitle>让系统保持在系统管理员掌握之中的关键，就是让尽可能多的任务自动完成……</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Open Source 4.21-zh-cn</generator>

<entry>
    <title>perl删除文件</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2009/01/perl-14.html" />
    <id>tag:supersun.biz,2009://8.913</id>

    <published>2009-01-06T06:44:14Z</published>
    <updated>2009-01-06T06:51:06Z</updated>

    <summary>使用unlink函数,如:perl -e &apos;$file=$ARGV[0];unl...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[使用unlink函数,如:<br />perl -e '$file=$ARGV[0];unlink $file' -- anaconda-ks.cfg<br />删除当前目录下的anaconda-ks.cfg ]]>
        
    </content>
</entry>

<entry>
    <title>已经2009年了</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2009/01/2009.html" />
    <id>tag:supersun.biz,2009://8.912</id>

    <published>2009-01-01T09:29:59Z</published>
    <updated>2009-01-01T09:30:58Z</updated>

    <summary></summary>
    <author>
        <name>supersun</name>
        
    </author>
    
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        
        
    </content>
</entry>

<entry>
    <title>开机时跳过键盘检查</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/post-117.html" />
    <id>tag:supersun.biz,2008://8.911</id>

    <published>2008-12-29T02:50:52Z</published>
    <updated>2008-12-29T02:52:17Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="系统管理" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="pc" label="PC" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><span style="">&nbsp;&nbsp;&nbsp; </span>有两台PC，安装了Linux系统，通过ssh进行控制，没连显示器和键盘，每次重启,系统自检,检查键盘的时就会停止,提示按F1继续。解决方法：<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="line-height: 200%; font-family: 宋体; color: black;">自检时按DEL进入CMOS，进入Standard
CMOS Features后选Halt On，然后选择"All，But Keyboard"，缺省的是"All Errors"，以下是几个选项：<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">No Errors<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">不管任何错误，均开机<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">All Errors<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">有任何错误均暂停，等候处理<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">All，But
Keyboard<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">有任何错误均暂停，等候处理，除了键盘以外<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">All，But
Diskette<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">有任何错误均暂停，等候处理，除了软驱以外<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">All，But Disk／Key<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">有任何错误均暂停，等候处理，除了软驱和键盘以外</span><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>

 ]]>
        
    </content>
</entry>

<entry>
    <title>使用模块Tie::File 将文件当着数组来操作</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/tiefile.html" />
    <id>tag:supersun.biz,2008://8.910</id>

    <published>2008-12-26T07:29:59Z</published>
    <updated>2008-12-26T07:33:19Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">利用Tie::File可以将文件的内容看着是一个数组来操作，具体示例如下：<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz perl]$ cat tie.pl </span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">#!/usr/bin/perl -w<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use strict;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use Tie::File;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my $file=shift;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my @arrary;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">tie @arrary,'Tie::File',$file;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">push @arrary,"hello";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">在文件的结尾增加一行</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">:hello<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz perl]$ cat test </span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">aaaaa<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz perl]$ perl tie.pl<span style="">&nbsp; </span>test </span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz perl]$ cat test </span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">aaaaa<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">hello<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz perl]$</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span><span style="line-height: 200%; font-family: 宋体; color: black;">我使用这个模块的目的主要是用于处理<a href="http://supersun.biz/2008/12/inotify.html">inotify脚本</a>生成的日志文件，因为之前一直使用logrotate及cron来实现文件的上传，cron的最小时间间隔是1分钟，间隔稍长了一点。</span><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>

 ]]>
        
    </content>
</entry>

<entry>
    <title>一个与awstats相关的小报表</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/awstats-1.html" />
    <id>tag:supersun.biz,2008://8.909</id>

    <published>2008-12-25T09:46:57Z</published>
    <updated>2008-12-25T09:55:58Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="perl" label="Perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="text-indent: 21pt; line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">几台服务器的apache日志使用awstat进行统计，现在需要将每台主机的每日访问文件数按日期排序，打印成一张表：<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">awstat生成的数据文件的文件名格式为：awstats102008.hostname.txt<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">20081017
2826794 2826794 340568061 59<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">20081018
2736667 2736667 336467614 58<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">20081019
3314638 3314638 352853200 56<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">需要获取的数据为上面的第一二列，即日期和文件数<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">#!/usr/bin/perl -w<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use strict;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my $data_dir="/opt/awstats/dirdata";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">chdir $data_dir;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my %data;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my $month=shift;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my $year="2008";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my $mod=shift;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my @hosts;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">@hosts=(21..28) if $mod eq "m";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">@hosts=(31..38) if $mod eq "t";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">print "&lt;html&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;head&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;title&gt;access log statistic&lt;/title&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;/head&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;body&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;h1&gt;access log statistic on $month $year&lt;/h1&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;h3&gt;&lt;a href='/'&gt;return to
index&lt;/a&gt;&lt;/h3&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;table border=1&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">foreach my $host (@hosts){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">my
$file="awstats".$month.$year.".".$host.".txt";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">next unless -f $file;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">open FD,$file;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">while(&lt;FD&gt;){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
$arrary=$_;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if ($arrary
=~ /^$year$month/){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
@tmp=split /\s+/,$arrary;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
$date=shift @tmp;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
$num=shift @tmp;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">$data{"d".$date}{"h".$host}=$num;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">close FD;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">print "&lt;tr&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">print "&lt;th&gt;date&lt;/th&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">foreach my $host (@hosts){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print
"&lt;th&gt;$host&lt;/th&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">print "&lt;/tr&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">foreach my $date (sort keys %data){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print
"&lt;tr&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print
"&lt;td&gt;$date&lt;/td&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>foreach my
$host (@hosts){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print
"&lt;td align='right'&gt;
",$data{$date}{'h'.$host}?$data{$date}{'h'.$host}:0,"
&lt;/td&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print
"&lt;/tr&gt;\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">print "&lt;/table&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&lt;h3&gt;&lt;a href='/'&gt;return to
index&lt;/a&gt;&lt;/h3&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;/body&gt;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">&lt;/html&gt;";</span><span style="line-height: 200%; font-family: 宋体;"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><br /><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p></o:p></span></p><p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>运行perl awstat_html.pl 12 m</o:p></span></p><p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>第一个参数是月份,第二个参数是服务器分组,我在脚本里定义了两个分组<br /></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">生成的结果如下：</span></p><h1>&nbsp;access statistic on 12 2008</h1>
<h3><a href="http://supersun.biz/">return to index</a></h3>

<table border="1"><tbody><tr>
<th>date</th>
<th>21</th>
<th>22</th>
<th>23</th>
<th>24</th>
<th>25</th>
<th>26</th>
<th>27</th>
<th>28</th>
</tr>
<tr>
<td>d20081201</td>
<td align="right"> 3889363 </td>
<td align="right"> 3510197 </td>
<td align="right"> 3822591 </td>
<td align="right"> 3705947 </td>
<td align="right"> 3648502 </td>
<td align="right"> 3507673 </td>
<td align="right"> 3575994 </td>
<td align="right"> 3595313 </td>
</tr>
<tr>
<td>d20081202</td>
<td align="right"> 3460608 </td>
<td align="right"> 3584238 </td>
<td align="right"> 3793175 </td>
<td align="right"> 3847570 </td>
<td align="right"> 3541112 </td>
<td align="right"> 4261298 </td>
<td align="right"> 3440269 </td>
<td align="right"> 3479714 </td>
</tr>
<tr>
<td>d20081203</td>
<td align="right"> 3543943 </td>
<td align="right"> 3480454 </td>
<td align="right"> 3747391 </td>
<td align="right"> 3865192 </td>
<td align="right"> 3400915 </td>
<td align="right"> 3621912 </td>
<td align="right"> 3579295 </td>
<td align="right"> 3459238 </td>
</tr>
<tr>
<td>d20081204</td>
<td align="right"> 3426827 </td>
<td align="right"> 3319026 </td>
<td align="right"> 3290832 </td>
<td align="right"> 3301444 </td>
<td align="right"> 3290683 </td>
<td align="right"> 3437950 </td>
<td align="right"> 3378622 </td>
<td align="right"> 3384148 </td>
</tr>
<tr>
<td>d20081205</td>
<td align="right"> 3029773 </td>
<td align="right"> 3124348 </td>
<td align="right"> 3057467 </td>
<td align="right"> 3026183 </td>
<td align="right"> 3367647 </td>
<td align="right"> 3028501 </td>
<td align="right"> 3196543 </td>
<td align="right"> 3221404 </td>
</tr>
<tr>
<td>d20081206</td>
<td align="right"> 2816795 </td>
<td align="right"> 2872855 </td>
<td align="right"> 2990546 </td>
<td align="right"> 3240831 </td>
<td align="right"> 2965240 </td>
<td align="right"> 2813721 </td>
<td align="right"> 2821424 </td>
<td align="right"> 3318829 </td></tr></tbody></table><p class="MsoNormal" style="line-height: 200%;"><br /></p>将就着看，呵呵。

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

 ]]>
        
    </content>
</entry>

<entry>
    <title>jdk快速安装脚本</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/jdk.html" />
    <id>tag:supersun.biz,2008://8.908</id>

    <published>2008-12-11T08:09:23Z</published>
    <updated>2008-12-11T08:10:43Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="系统管理" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bash" label="bash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="java" label="JAVA" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="chsdate" downloadurl=""></o:smarttagtype><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="text-indent: 21pt; line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">如果你有多台服务器需要安装JDK，不妨使用以下的脚本，在安装前定制一下脚本中的变量：JKD_ARCHIVE（jdk压缩包文件名）
JDK_VERSION(解压后的目录名) INSTALL_DIR(目标目录)<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">#!/bin/sh<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">#auther:supersun<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">#email:supersun06@gmail.com<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">#homepage:http://supersun.biz<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">JKD_ARCHIVE="jdk1.5.tgz"<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">JDK_VERSION="jdk<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">1.5.0</st1:chsdate>_017"<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">INSTALL_DIR="/usr/local/"<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">HOSTLISTS="$*"<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">for HOST in $HOSTLISTS<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">do<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">ssh $HOST " if [ -d ${INSTALL_DIR}${JDK_VERSION} ]<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">then<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;</span>echo $JDK_VERSION
has been installed<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">else<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;</span>echo<span style="">&nbsp; </span>$JDK_VERSION hasnot been installed<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;</span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">cd $INSTALL_DIR<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE"><span style="">&nbsp;</span>tar zxf -<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE"><span style="">&nbsp;</span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">test -L java &amp;&amp; rm java<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;</span>ln -s $JDK_VERSION
java<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;</span>cat
&gt;/etc/profile.d/java.sh &lt;&lt;'EOF'<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">#!/bin/sh<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">JAVA_HOME=/usr/local/java<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">PATH=\$JAVA_HOME/bin:\$PATH<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">export JAVA_HOME PATH<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">EOF<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">fi" &lt;$JKD_ARCHIVE<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">done<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体;">用法如下</span><span style="line-height: 200%; font-family: 宋体;">：<span style="background: silver none repeat scroll 0% 0%; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz java]$ sudo sh ins_jdk.sh host1<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">Password:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">jdk<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">1.5.0</st1:chsdate>_017 hasnot
been installed<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[supersun@supersun.biz java java]$ s ssh mss1<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">Last login: Thu Dec 11 15:47:12 2008 from supersun.biz <o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@host1 ~]# which java<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">/usr/local/java/bin/java<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

 ]]>
        
    </content>
</entry>

<entry>
    <title>此页面重定向不正确</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/post-116.html" />
    <id>tag:supersun.biz,2008://8.907</id>

    <published>2008-12-10T15:10:17Z</published>
    <updated>2008-12-10T15:12:05Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="生活琐事" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="firefox" label="FireFox" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="line-height: 200%;"><span style="font-family: 宋体;">&nbsp;&nbsp;&nbsp; 登陆<span lang="EN-US">GOOGLE</span>日历<span lang="EN-US">,Firefox</span>提示<span lang="EN-US">"</span>此页面重定向不正确<span lang="EN-US">",Firefox</span>菜单<span lang="EN-US">"</span>工具<span lang="EN-US">"-&gt;</span>选项<span lang="EN-US">-&gt;</span>隐私<span lang="EN-US">-&gt;"</span>显示<span lang="EN-US">Cookie" </span>然后关<span lang="EN-US">google</span>日历的<span lang="EN-US">Cookie</span>删除<span lang="EN-US">,</span>重新登陆<span lang="EN-US">Google</span>日历<span lang="EN-US">,</span>不再报错。<span lang="EN-US"><o:p></o:p></span></span></p>

]]>
        
    </content>
</entry>

<entry>
    <title>如何获取进程的启动时间</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/post-115.html" />
    <id>tag:supersun.biz,2008://8.906</id>

    <published>2008-12-10T03:40:44Z</published>
    <updated>2008-12-10T03:46:05Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="脚本与编程" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="进程" label="进程" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="chsdate" downloadurl=""></o:smarttagtype><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="chmetcnv" downloadurl=""></o:smarttagtype><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:42.55pt;
	mso-footer-margin:49.6pt;
	mso-paper-source:0;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体;">作者<span lang="EN-US">: <a href="http://blog.sina.com.cn/u/1299145241" target="_blank"><span style="color: windowtext;">PuGuangH</span></a> </span>原文链接<span lang="EN-US">: </span></span><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><a href="http://blog.sina.com.cn/s/blog_4d6f6219010009n7.html">http://blog.sina.com.cn/s/blog_4d<st1:chmetcnv unitname="F" sourcevalue="6" hasspace="False" negative="False" numbertype="1" tcsc="0" w:st="on">6f</st1:chmetcnv>6219010009n7.html</a><span style="background: silver none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><o:p></o:p></span></span></p>



<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">PID=$1<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">JIFFIES=`cat /proc/$PID/stat | cut -d" " -f22`<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">UPTIME=`grep btime /proc/stat | cut -d" " -f2`<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">START_SEC=$(( $UPTIME + $JIFFIES / 100 ))<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">START_TIME=`date -d "<st1:chsdate year="1970" month="1" day="1" islunardate="False" isrocdate="False" w:st="on">1970-1-1</st1:chsdate>
UTC $START_SEC seconds"`<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">echo $START_TIME</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><span style="">&nbsp;</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">其中</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">PID</span><span style="line-height: 200%; font-family: 宋体; color: black;">中要传入对应的进程</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">ID</span><span style="line-height: 200%; font-family: 宋体; color: black;">。</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><span style="">&nbsp;</span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">其中</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">/proc/stat</span><span style="line-height: 200%; font-family: 宋体; color: black;">中的</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">btime</span><span style="line-height: 200%; font-family: 宋体; color: black;">指的是系统的启动时间</span><span style="line-height: 200%; font-family: 宋体; color: black;">，</span><span style="line-height: 200%; font-family: 宋体; color: black;">也就是</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">boot time</span><span style="line-height: 200%; font-family: 宋体; color: black;">，<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">对于一个具体的进程<span style="">&nbsp;
</span>/proc/$pid/stat中对应的第22项指的是该进程相对于系统启动以来的执行时间。</span><span style="line-height: 200%; font-family: 宋体;" lang="EN-US"><o:p></o:p></span></p>

]]>
        
    </content>
</entry>

<entry>
    <title>用inotify监控文件系统事件备份海量小文件</title>
    <link rel="alternate" type="text/html" href="http://supersun.biz/2008/12/inotify.html" />
    <id>tag:supersun.biz,2008://8.905</id>

    <published>2008-12-09T07:11:02Z</published>
    <updated>2008-12-09T07:12:34Z</updated>

    <summary>     Normal   0      7.8 磅   0   2      ...</summary>
    <author>
        <name>supersun</name>
        
    </author>
    
        <category term="系统管理" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="inotify" label="inotify" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="Linux" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="zh-cn" xml:base="http://supersun.biz/">
        <![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CHP%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="chsdate" downloadurl=""></o:smarttagtype><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:PunctuationKerning/>
  <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:SpaceForUL/>
   <w:BalanceSingleByteDoubleByteWidth/>
   <w:DoNotLeaveBackslashAlone/>
   <w:ULTrailSpace/>
   <w:DoNotExpandShiftReturn/>
   <w:AdjustLineHeightInTable/>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id="ieooui"></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]--><style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:宋体;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:SimSun;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:"\@宋体";
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:3 135135232 16 0 262145 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	mso-pagination:none;
	font-size:10.5pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:宋体;
	mso-font-kerning:1.0pt;}
 /* Page Definitions */
 @page
	{mso-page-border-surround-header:no;
	mso-page-border-surround-footer:no;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:普通表格;
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]-->

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span>inotify</span><span style="line-height: 200%; font-family: 宋体; color: black;">是Linux内核的新功能，用于监控文件系统的事件，此功能对于海量小文件的备份很有帮助。<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><span style="">&nbsp;&nbsp;&nbsp; </span>我手头管理着一组服务器，每台服务器上存放大量小文件，一天之中，更新的文件数量达到30万左右（这个数据是从rsync的日志中得到的，每天我们会运行一组rsync脚本，用于备份数据。完成同步需要6个小时左右，每天的同一文件的多次变动还未计算在内），为了将在发生意外时，数据的损失减少到尽可能的小，我们通过linux的inotify功能，监控数据文件的目录，对创建，更改操作进行监控，并将文件的路径记入到日志文件中，每一分钟备份一次更新的文件。<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">整个脚本的部署分为以下几个步骤:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">1、升级Linux内核，使其支持inotify功能<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">2、安装脚本所需的Perl模块。<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">3、生成监控数据,运行脚本<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">4、定制并运行日志外理命令。<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">5、管理inotify脚本。<o:p></o:p></span></p><br />]]>
        <![CDATA[<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">具体过程如下:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">1、升级Linux内核，使其支持inotify功能</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp; </span></span><span style="line-height: 200%; font-family: 宋体; color: black;">使用inotify功能需要采用新的内核，我们以<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>的内核为例，编译内核的步骤如下：<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
KERNEL_DIR=$(pwd)<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make mrproper<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make menuconfig<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make dep<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make clean<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make bzImage<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
cp arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.26<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make modules<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
make modules_install<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
cd /boot<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz boot]# mkinitrd initrd-2.6.26 <st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">[root@supersun.biz boot]# cd $KERNEL_DIR<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
cp System.map /boot/System.map-2.6.26<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
cd /boot<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz linux-<st1:chsdate year="1899" month="12" day="30" islunardate="False" isrocdate="False" w:st="on">2.6.26</st1:chsdate>]#
ln -s System.map-2.6.26 System.map</span><span style="line-height: 200%; font-family: 宋体; color: blue;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">重启系统使用新内核。<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">2、安装脚本所需的Perl模块<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz ~]# cpan Event<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">[root@supersun.biz ~]# cpan Linux::Inotify2</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">3、生成监控数据,运行脚本<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">创建inotifyd.pl脚本,脚本内容如下:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">#!/usr/bin/perl <o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">#auther:supersun<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="DE">#e-mail:supersun06@gmail.com<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">#blog:http://supersun.biz<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use strict;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use Event;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use Linux::Inotify2;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use POSIX;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">use IO::File;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">#For Daemon <o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">###################################################<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">sub daemonize {<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>chdir
"/";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>open STDIN,
"&lt;/dev/null";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>open
STDOUT, "&gt;/dev/null";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>open
STDERR, "&gt;&amp;STDOUT";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;</span>defined(my $pid=fork) or die "Can't fork:
$!\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>exit
if($pid);<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>POSIX::setsid() or die "Can't start a new session: $!";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>umask 0;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">sub get_log {<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
($LOG_FILE,$LOGS)=@_;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
$TIME=localtime;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>open
LOG,'&gt;&gt;',$LOG_FILE;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print LOG
"$LOGS\n";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>close LOG;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">sub add_watch {<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
($inotify,$log_file)=@_;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>open
FH,$log_file;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>while(&lt;FH&gt;){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my
$file=$_;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>chomp $file;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;</span>$inotify-&gt;watch ($file, IN_ALL_EVENTS,
\&amp;mywatch)<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>close
FH;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">####################################################<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">&amp;daemonize;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">our $CONF_FILE="/var/log/inotify.db";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">our $LOG_FILE="/var/log/inotify.log";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">our $INOTIFY_OBJECT=new Linux::Inotify2;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">Event-&gt;io (fd =&gt; $INOTIFY_OBJECT-&gt;fileno, poll
=&gt; 'r', repeat =&gt; 1, cb =&gt; sub { $INOTIFY_OBJECT-&gt;poll });<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">Event-&gt;signal (signal =&gt; 'HUP',cb =&gt;
\&amp;re_conf); <o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">add_watch($INOTIFY_OBJECT,$CONF_FILE);<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">Event::loop;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">sub re_conf{<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>add_watch($INOTIFY_OBJECT,$CONF_FILE);<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">Event::loop;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">sub mywatch {<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my $e =
shift;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my $PATH=
$e-&gt;fullname;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>my $MASK=
$e-&gt;mask;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp; </span><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>$INOTIFY_OBJECT-&gt;watch($PATH,IN_ALL_EVENTS, \&amp;mywatch) if ($e-&gt;IN_CREATE);<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">if($e-&gt;IN_ISDIR &amp;&amp; $e-&gt;IN_CREATE) {<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>get_log $LOG_FILE, "$PATH";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>return;<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>if($e-&gt;IN_MODIFY || $e-&gt;IN_CREATE){<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>get_log $LOG_FILE, "$PATH";<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>return<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;&nbsp;&nbsp;</span>}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: silver none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: blue; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">}<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">添加执行权限</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">,</span><span style="line-height: 200%; font-family: 宋体; color: black;">并</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">copy</span><span style="line-height: 200%; font-family: 宋体; color: black;">至</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">/usr/local/sbin/</span><span style="line-height: 200%; font-family: 宋体; color: black;">目录下</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">.<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">创建监控目录列表</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">,</span><span style="line-height: 200%; font-family: 宋体; color: black;">便例如</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US">:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="background: black none repeat scroll 0% 0%; line-height: 200%; font-family: 宋体; color: lime; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" lang="EN-US">find /home/data -type d &gt;/var/log/inotify.db</span><span style="line-height: 200%; font-family: 宋体; color: black;" lang="EN-US"><o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">启动inotifyd.pl脚本:<o:p></o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal" style="line-height: 200%;"><span style="line-height: 200%; font-family: 宋体; color: black;">对于65万行的记录启动时间大约是一分半钟，至此，inotidyd.pl脚本已经开始监控，脚本分将发生IN_MODIFY和IN_CREATE事件的文件记入到/var/log/inotify.log中。<o:p></o:p></span></p>

<p class="MsoNo