一、简介

rotatelogs 是 Apache 自带的管道日志程序,可以完美的实现日志的轮转功能。

二、语法

Usage: rotatelogs [-v] [-l] [-L linkname] [-p prog] [-f] [-t] [-e] [-c] <logfile> {<rotation time in seconds>|<rotation size>(B|K|M|G)} [offset minutes from UTC]

Add this:

TransferLog "|rotatelogs /some/where 86400"

or 

TransferLog "|rotatelogs /some/where 5M"

to httpd.conf. By default, the generated name will be
<logfile>.nnnn where nnnn is the system time at which the log
nominally starts (N.B. if using a rotation time, the time will
always be a multiple of the rotation time, so you can synchronize
cron scripts with it). If <logfile> contains strftime conversion
specifications, those will be used instead. At the end of each
rotation time or when the file size is reached a new log is
started. Options:
-v Verbose operation. Messages are written to stderr.
-l Base rotation on local time instead of UTC.
-L path Create hard link from current log to specified path.
-p prog Run specified program after opening a new log file. See below.
-f Force opening of log on program start.
-t Truncate logfile instead of rotating, tail friendly.
-e Echo log to stdout for further processing.
-c Create log even if it is empty. The program is invoked as "[prog] <curfile> [<prevfile>]"
where <curfile> is the filename of the newly opened logfile, and
<prevfile>, if given, is the filename of the previously used logfile.

三、实例

Apache rotatelogs命令的更多相关文章

  1. Mac中Apache常用命令

    Apache常用命令记录,还是记一下吧,总是忘记. Apache常用命令: # sudo apachectl start // 启动Apache服务 # sudo apachectl stop // ...

  2. Apache htpasswd命令用法详解

    一. 基础 htpasswd建立和更新存储用户名.密码的文本文件, 用于对HTTP用户的basic认证. # /usr/local/apache/bin/htpasswd –help Usage: h ...

  3. Apache配置命令

    Apache的主配置文件: 1.DocumentRoot——指定网站的根目录 提示:该目录必须存在.目录上不能有汉字或空格. 2.DirectoryIndex (1)描述:设置网站的默认首页文件.访问 ...

  4. Apache apachectl命令

    一.简介 apachectl命令是Apache的Web服务器前端控制工具,用以启动.关闭和重新启动Web服务器进程. 二.语法 http://www.jinbuguo.com/apache/menu2 ...

  5. Apache htdigest命令

    一.简介 htdigest命令是Apache的Web服务器内置工具,用于创建和更新储存用户名.域和用于摘要认证的密码文件.服务器上的资源可以被限制为仅允许由htdigest建立的文件中的用户访问.使用 ...

  6. Apache fcgistarter命令

    一.简介 fcgistarter命令用于启动FastCGI程序. 二.语法 fcgistarter -c command -p port [ -i interface ] -N num 参考:http ...

  7. ubuntu中安装apache ab命令进行简单压力测试

    1.安装ab命令 写道 apt-get install apache2-utils 2.ab命令参数说明. 写道 Usage: ab [options] [http[s]://]hostname[:p ...

  8. apache管理命令

    常用的 httpd.exe -k [install(安装).uninstall(卸载).start(启动).stop(停止).restart(重启)] 说明:要执行命令,需进入到apache安装目录/ ...

  9. Apache Flink - 命令

    $flink命令位置 命令 选项 jar包位置 \ --input 输入文件位置 --out 输出文件位置 ./bin/flink run ./examples/batch/WordCount.jar ...

随机推荐

  1. PCANet

    从上图可以看到,PCANet的训练分为三个步骤(stage),前两个stage很相似,都是去平均,然后PCA取主成分并卷积,最后一步是二值化(为了产生非线性输出)和直方图量化. 设滤波器个数为f, 1 ...

  2. 双色球基础分析--SQL

    代码是心血来潮编写得,就象买彩票一样,为国家做贡献:首先建立一个表,表得数据可以从福利彩票网站上获得,自己一个一个得录入进去先: 表结构为: ) NOT NULL ,  --期数    [F1] [i ...

  3. Python 代码使用pdb调试技巧

    Debug 对于任何开发人员都是一项非常重要的技能,它能够帮助我们准确的定位错误,发现程序中的 bug.python 提供了一系列 debug 的工具和包,可供我们选择.本文将主要阐述如何利用 pyt ...

  4. MySQL连接查询、联合查询、子查询

    参考地址:http://blog.csdn.net/u011277123/article/details/54863371 1.MySQL连接查询 连接查询:将多张表(>=2)进行记录的连接(按 ...

  5. nginx 限制

    在nginx.conf里的http{}里添加: http{ limit_conn_zone $binary_remote_addr zone=perip:10m; limit_conn_zone $s ...

  6. week01—绪论

    一.作业题目 仿照三元组或复数的抽象数据类型写出有理数抽象数据类型的描述 (有理数是其分子.分母均为整数且分母不为零的分数). 有理数基本运算: 构造有理数T,元素e1,e2分别被赋以分子.分母值 销 ...

  7. 蓝桥杯 算法训练 ALGO-21 装箱问题

     算法训练 装箱问题   时间限制:1.0s   内存限制:256.0MB 问题描述 有一个箱子容量为V(正整数,0<=V<=20000),同时有n个物品(0<n<=30),每 ...

  8. 实战 TestNG 监听器

    TestNG 是一个开源的自动化测试框架,其灵感来自 JUnit 和 NUnit,但它引入了一些新功能,使其功能更强大,更易于使用.TestNG 的设计目标是能够被用于进行各种类型测试:单元测试.功能 ...

  9. juc原子类之五:AtomicLongFieldUpdater原子类

    概要 AtomicIntegerFieldUpdater, AtomicLongFieldUpdater和AtomicReferenceFieldUpdater这3个修改类的成员的原子类型的原理和用法 ...

  10. 1130 Infix Expression

    题意:给出一个语法树(二叉树),输出相应的中缀表达式. 思路:很显然,通过中序遍历来做.通过观察,发现除了根结点之外的所有非叶结点的两侧都要输出括号,故在中序遍历时判断一下即可. 代码: #inclu ...