O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

logrotate

Synopsis

                  logrotate [options] config_files
               

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

Options

-d, --debug

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

-f, --force

Force rotation of log files.

-h, --help

Describe options.

-m command, --mail command

Use the specified command to mail log files. The default 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 log files are affected.

Commands

compress

Compress old versions of log files with gzip.

compresscmd command

Use command to compress log files. 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 log file, but do not change the original.

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.

endscript

End a postrotate or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required