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