This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
aix:logrotate [2021/12/06 17:29] manu |
aix:logrotate [2023/08/08 17:58] (current) manu |
||
|---|---|---|---|
| Line 43: | Line 43: | ||
| # RPM packages drop log rotation information into this directory | # RPM packages drop log rotation information into this directory | ||
| include /etc/logrotate.d | include /etc/logrotate.d | ||
| - | + | </cli> | |
| + | <cli prompt='>'> | ||
| [eco-aix61@root] /var/log> cat /etc/logrotate.d/system.conf | [eco-aix61@root] /var/log> cat /etc/logrotate.d/system.conf | ||
| # Most common AIX files | # Most common AIX files | ||
| Line 84: | Line 84: | ||
| olddir /var/log/news/old | olddir /var/log/news/old | ||
| } | } | ||
| - | </cli> | ||
| - | } | ||
| - | |||
| </cli> | </cli> | ||
| Line 102: | Line 99: | ||
| In case of trouble, start manually logrotate with debug and verbose options: | In case of trouble, start manually logrotate with debug and verbose options: | ||
| /usr/sbin/logrotate -dv /etc/logrotate.conf | /usr/sbin/logrotate -dv /etc/logrotate.conf | ||
| + | | ||
| + | Change compression program | ||
| + | <cli prompt='>'> | ||
| + | /tmp/output.log { | ||
| + | size 1k | ||
| + | copytruncate | ||
| + | create | ||
| + | compress | ||
| + | compresscmd /bin/bzip2 | ||
| + | compressext .bz2 | ||
| + | rotate 4 | ||
| + | } | ||
| + | </cli> | ||
| + | |||
| + | ===== Delete a specific log file ===== | ||
| + | |||
| + | <cli prompt='$'> | ||
| + | $ cat /etc/logrotate.d/app | ||
| + | |||
| + | /var/log/app/*.old { | ||
| + | hourly | ||
| + | rotate 0 | ||
| + | firstaction | ||
| + | /usr/bin/find /var/log/app/ -name "*.old" -mtime +1 -delete | ||
| + | endscript | ||
| + | nocreate | ||
| + | missingok | ||
| + | notifempty | ||
| + | } | ||
| + | </cli> | ||