Name

logrotate

Synopsis

logrotate [options] config_files

Description

System administration command. Manipulate log files according to commands given in config_files.

Options

-d

Debug mode. No changes will be made to log files.

-s, --state file

Save state information in file. The default is /var/lib/logrotate.status.

--usage

Usage version and copyright information.

Commands

compress

Compress old versions of log files with gzip.

copytruncate

Copy log file, then truncate it in place. For use with programs whose logging cannot be temporarily halted.

create [permissions] [owner] [group]

After rotation, re-create log file with the specified permissions, owner, and group. permissions must be in octal. If any of these parameters is missing, the log file’s original attributes will be used.

daily

Rotate log files every day.

delaycompress

Don’t compress log file until the next rotation.

errors address

Mail any errors to the given address.

endscript

End a postrotate or prerotate script.

ifempty

Rotate log file even if it is empty. Overrides the default notifempty option.

include file

Read the file into current file. If file is a directory, read all files in that directory into the current file.

mail address

Mail any deleted logs to address.

monthly

Rotate log files only the first time logrotate is run in a month.

nocompress

Override compress.

nocopytruncate

Override copytruncate.

nocreate

Override create.

nodelaycompress

Override delaycompress.

noolddir

Override olddir.

notifempty

Override ifempty ...

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.