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 ...
Get Linux in a Nutshell, Fourth 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.