一、简介

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. idea的有些路径问题

    resource文件在xml的路径 http://www.cnblogs.com/zqr99/p/7642712.html resource文件在io流的读取 this.getClass().getR ...

  2. C# 动态加载WebService

    项目中需要用到WebService的方式来进行两个服务之间的方法调用,之前都是在项目中添加服务引用的方式来实现,但是这种方式有一个弊端,就是如果提供WebService服务的一方的IP.端口一旦变更, ...

  3. EM64T和64位是不是一个概念啊?他们有什么区别啊,怎么区分啊?

    首先我们要解决什么是64位这个问题.究竟什么是64位处理器呢?64 bit是相对于32 Bit而言的,这个位数指的是CPU GPRs(General-Purpose Registers,通用寄存器)数 ...

  4. mysql函数之一:INSTR、LOCATE、POSITION VS LIKE

    LOCATE.POSITION和INSTR函数相似功能实例 使用LOCATE.POSITION和INSTR函数查找字符串中指定子字符串的开始位置.SQL语句如下: mysql>SELECT LO ...

  5. innodb事务日志详解

    首先看InnoDB的缓存和文件的关系图如下: InnoDB事务日志功能介绍 InnoDB使用日志来减少提交事务时的开销.因为日志中已经记录了事务,就无须在每个事务提交时把缓冲池的脏块刷新(flush) ...

  6. juc原子类之二:基本类型原子类AtomicInteger(AtomicLong、AtomicBoolean)

    一.AtomicInteger简介 AtomicInteger, AtomicLong和AtomicBoolean这3个基本类型的原子类的原理和用法相似.以AtomicInteger对基本类型的原子类 ...

  7. python使用pika链接rabbitmq Connection reset by peer 解决办法

    记录一下, 最近在用机器学习打算做一个Rest API, 数据存入mongo,任务采用消息队列,rabbitmq 由于引擎采用python编写,所以WEB也直接打算用python编写了,比较省事. W ...

  8. Linux Restricted Shell Bypass

    Author: @n4ckhcker & @h4d3sw0rm Introduction Hello, so first of all let’s explain what is a rest ...

  9. Linux - rpm 软件包管理

    rpm 是 Red-Hat Package Manager(rpm 软件包管理器)的缩写 rpm 的命名规则: 第一部分为 rpm 软件包的名称,第二部分是版本号,第三部分是版本发布次数,第四部分是软 ...

  10. HTTP及XMLHTTP状态代码一览

    (一) HTTP 1.1支持的状态代码 100 Continue 初始的请求已经接受,客户应当继续发送请求的其余部分 101 Switching Protocols 服务器将遵从客户的请求转换到另外一 ...