Latest web development tutorials

Linux logrotate command

Linux command Daquan Linux command Daquan

Linux logrotate command is used to manage log files.

Use logrotate command that allows you to easily manage log files generated by the system. It provides automatic replacement, compression, removal and mailing of log files, each file can be set to record daily, weekly or monthly processing, it can be processed as soon as the file is too large. You have to edit their own, specify the configuration file, the default configuration file is stored in the / etc directory, file name logrotate.conf.

grammar

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

Parameter Description:

  • -? Or --help online help.
  • -d or --debug detail display during the execution of instructions, easy to understand the situation or debugging program execution.
  • -f or --force forcibly boot record file maintenance operations, even if logrotate command sees no need versa.
  • -s <status file> or --state = <status file> with the specified state file.
  • -v or --version display process execution instruction.
  • -usage display basic usage instructions.

Examples

Specifies the log file

# logrotate /root/log.config

Linux command Daquan Linux command Daquan