uTools-Manuals/docs/linux/logrotate.html
2019-04-21 11:50:48 +08:00

17 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="logrotate">logrotate</h1>
<p>统日志进行轮转、压缩和删除</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>logrotate命令</strong> 用于对系统日志进行轮转、压缩和删除也可以将日志发送到指定邮箱。使用logrotate指令可让你轻松管理系统所产生的记录文件。每个记录文件都可被设置成每日每周或每月处理也能在文件太大时立即处理。您必须自行编辑指定配置文件预设的配置文件存放在<code>/etc/logrotate.conf</code>文件中。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">logrotate(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-?或--help在线帮助
-d或--debug详细显示指令执行过程便于排错或了解程序执行的情况
-f或--force 强行启动记录文件维护操作纵使logrotate指令认为没有需要亦然
-s&lt;状态文件&gt;或--state=&lt;状态文件&gt;:使用指定的状态文件;
-v或--version显示指令执行过程
-usage显示指令基本用法。</code></pre>
<h3 id="参数">参数</h3>
<p>配置文件指定lograote指令的配置文件。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->