Differences
This shows you the differences between two versions of the page.
linux_wiki:log_rotate [2015/10/04 01:19] billdozor created |
linux_wiki:log_rotate [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Log Rotate ====== | ||
- | |||
- | **General Information** | ||
- | |||
- | * The package " | ||
- | * Logrotate is executed via a daily cron job: / | ||
- | |||
- | **Checklist** | ||
- | * Distro: Enterprise Linux 6 | ||
- | |||
- | ---- | ||
- | |||
- | ===== Force Rotation ===== | ||
- | |||
- | Forcing a log rotation can be useful after implementing a new rotation file (in / | ||
- | |||
- | * To force a logrotate using a specific config file | ||
- | * <code bash>/ | ||
- | * To force a logrotate of ALL log files | ||
- | * <code bash>/ | ||
- | |||
- | ---- | ||
- | |||
- | ===== / | ||
- | |||
- | / | ||
- | |||
- | Ensure that / | ||
- | <code bash> | ||
- | include / | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ===== / | ||
- | |||
- | All additional log configuration files go in: / | ||
- | |||
- | Example Log Config | ||
- | <code bash> | ||
- | ## Application Logs ## | ||
- | / | ||
- | #Rotate monthly | ||
- | monthly | ||
- | | ||
- | #Keep 12 old log files, delete older | ||
- | rotate 12 | ||
- | | ||
- | #Copy current log to rotated, then truncate in place | ||
- | copytruncate | ||
- | | ||
- | #Give rotated log file a date extension YYYYMMDD | ||
- | dateext | ||
- | | ||
- | #Compress old log files with gzip | ||
- | compress | ||
- | } | ||
- | </ | ||
- | |||
- | ---- | ||