The logrotate command supports these options in the configuration file:
|
Parameter
|
Description
|
|
missingok |
This ignores if the log file is missing and return without rotating the log. |
|
notifempty |
This only rotates the log if the source log file is not empty. |
|
size 30k |
This limits the size of the log file for which the rotation is to be made. It can be 1 M for 1 MB. |
|
compress |
This enables compression with gzip for older logs. |
|
weekly |
This specifies the interval at which the rotation is to be performed. It can be weekly, yearly, or daily. |
|
rotate 5 |
This is the number of older copies of log file archives to be kept. Since 5 is specified, there will be program.log.1.gz, program.log.2.gz, and so on up to program.log.5.gz. |
|
create 0600 root root |
This specifies the mode, user, and the group of the log file archive to be created. |
The options in the table are examples of what can be specified. More options can be defined in the logrotate configuration file. Refer to the man page at http://linux.die.net/man/8/logrotate, for more information.