Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux logrotate Command

Linux logrotate Command

Linux Command Reference Linux Command Reference

The Linux logrotate command is used to manage log files.

The logrotate command makes it easy to manage log files generated by the system. It provides automatic rotation, compression, removal, and mailing of log files. Each log file can be configured to be handled daily, weekly, or monthly, or immediately when it becomes too large. You must edit the configuration file yourself; the default configuration file is stored in the /etc directory under the name logrotate.conf.

Syntax

logrotate [-?dfv][-s <状态文件>][--usage][配置文件]

Parameter Description:

Example

Specify the log file

# logrotate /root/log.config

Linux Command Reference Linux Command Reference