Apache rotatelogs Command

Source: Internet
Author: User

First, Introduction

Rotatelogs is Apache's own pipeline log program, can be perfect to achieve the rotation of the log function.

Second, the grammar

Usage:rotatelogs [-v] [-l] [-l linkname] [-P prog] [-f] [-t] [-e] [-c] <logfile> {<rotation Time inchSeconds>|<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 would be<logfile>.nnnn where nnnn is the system TimeAtwhichThe lognominally starts (n.b.ifUsing a rotation Time, the Timewillalways be a multiple of the rotation Time, so you can synchronizecron scripts with it). If<logfile>contains strftime conversionspecifications, those would be used instead. at the end of Eachrotation Timeor when thefilesize is reached a new log isstarted. Options:-v Verbose operation.  Messages is written to stderr. -L Base rotation on local Timeinstead of UTC. -L path Create hard link from the current log to specified path. -P prog Run specified program after opening a new logfile.  See below. -f Force Opening of Log on program start. -T Truncate logfile instead of rotating,Tailfriendly. -e Echo log to stdout forfurther processing. -C Create Log evenifit is empty. The program is invoked as"[prog] <curfile> [<prevfile>]"where<curfile>is the filename of the newly opened logfile, and<prevfile>,ifGiven, is the filename of the previously used logfile.

Third, examples

http://Www.lao8.org/article_1444/fangwenrizhi_antian

Apache rotatelogs Command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.