How to use the Linux logrotate command

Source: Internet
Author: User

Using the logrotate command allows you to easily manage the records generated by the system. It provides automatic replacement, compression, deletion, and mailing of record files. Each record file can be set to be processed every day, every week, or every month, and can be processed immediately when the file is too large. You must edit the configuration file by yourself. The default configuration file is stored in the/etc directory, and the file name is logrotate. conf.

Syntax

Logrotate [-? Dfv] [-s <status File>] [-- usage] [configuration file]

Parameter description:

  • -? Or -- help online help.
  • -D or -- debug displays the instruction execution process in detail to facilitate troubleshooting or understanding program execution.
  • -F or -- force forcibly start the file maintenance operation, even if the logrotate command does not think it is necessary.
  • -S <state File> or -- state = <state File> use the specified state file.
  • -V or -- version displays the command execution process.
  • -Basic usage of the usage display command.

Instance

Specify record file

# Logrotate/root/log. config

Related Article

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.