一、简介

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. 剑指Offer面试题:11.调整数组顺序使奇数位于偶数前面

    一 题目:调整数组顺序使奇数位于偶数前面 题目:输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有奇数位于数组的前半部分,所有偶数位于数组的后半部分. 二 解题思路 如果不考虑时间复杂度 ...

  2. C#进阶之路(七)反射的应用

    反射在C#中的应用还是很多的,但它对代码的性能有一定影响. 反射的性能: 使用反射来调用类型或者触发方法,或者访问一个字段或者属性时clr 需要做更多的工作:校验参数,检查权限等等,所以速度是非常慢的 ...

  3. C# null和" "的区别

    String str1 = null;   str引用为空 String str2 = "";      str引用一个空串 也就是null没有分配空间,""分 ...

  4. String类的一些常规方法

    String类 String类常用方法: ①length(): length()       长度    方法** 对比:数组.length      属性** 一般情况下,一个数字,一个字母,一个汉 ...

  5. gradle 安装试用

    1. java 环境(jdk 6 以上,最好使用8以及以上) yum install -y java-1.8.0-openjdk-devel 2. 基本配置 // path 路径 export PAT ...

  6. mysql复制(高可用架构方案的基础)

    mysql复制:把一个数据库实例上所有改变复制到另外一个数据库库服务器实例的过程特点:1.没有改变就无所谓复制 ;改变是复制的根本与数据源2.所有的改变:是指可以复制全部改变,也可以复制部分改变 可以 ...

  7. MongoDB Data Model 浅谈

    MongoDB 对于数据的 schema 要求很灵活. 与 MySQL 相比,collection 并不会强制文档的结构.(MySQL 在定义表时, 需要指定有哪些字段.类型.展示长度等) 因此,插入 ...

  8. win7 网站发布备注

    1.更改 .NET Framework 版本(改原设置v2.0 为v4.0) 2.程序池设置 3.基本设置 4.Web.config (debug="false") <sys ...

  9. python selenium中iframe切换、window切换方法

    一.selenium中iframe切换方法: 方法一:switch_to.frame frame函数中提供了三种定位方法:by index, name, or webelement. driver.s ...

  10. Jenkins修改端口号(windows系统)

    windows下改端口号: Jenkins安装成功后,默认的端口为8080. 如果该端口号与其他服务的端口号冲突,则需要更改Jenkins的端口号. 具体方法为: 修改Jenkins安装目录下的 je ...