Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access