Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

logrotate

Synopsis

logrotate [options] config_files

System administration command. Manipulate logfiles according to commands given in config_files.

Options

-d, --debug

Debug mode. No changes will be made to logfiles.

-f, --force

Force rotation of logfiles.

-h, --help

Describe options.

-m command, --mail command

Use the specified command to mail logfiles. The default command is /bin/mail -s.

-s file, --state file

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

--usage

Show syntax and options.

-v, --verbose

Describe what is being done and what logfiles are affected.

Configuration commands

Logrotate directives may appear on their own or as part of logfile definitions--instructions for specific logfiles. You may use wildcards to specify those files. Enclose directives for logfile definitions in a beginning and ending curly brace. For example:

compress
/var/log/messages {
rotate 5
weekly
}
compress

Compress old versions of logfiles with gzip.

compresscmd command

Use command to compress logfiles. Default is gzip.

compressext extension

Append filename extension to compressed files instead of the compress command’s default.

compressoptions options

Specify options to pass to the compress command. Default for gzip is −9 for maximum compression.

copy

Copy logfile, but do not change the original.

copytruncate

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

create [permissions] [owner] [group]

After rotation, re-create logfile with the specified ...

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.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page