logrotate
约 1 分钟阅读
- logrotate/logrotateGitHublogrotate/logrotatelogrotate/logrotate · /etc/logrotate.conf · /etc/logrotate.d/ · 通过 cron 执行 · 参考 /etc/logrotate.d笔记:logrotate
- /etc/logrotate.conf
- /etc/logrotate.d/
- 通过 cron 执行
# 配置 /etc/logrotate.conf
# 任务 /etc/periodic/daily/logrotate
apk add logrotateinclude /etc/logrotate.d配置
/var/log/apache2/* {
weekly
rotate 3
size 10M
compress
delaycompress
}
/var/log/squid/access.log {
monthly
create 0644 root root
rotate 5
size=1M
dateext
dateformat -%d%m%Y
notifempty
# mail [email protected]
}
/var/log/k3s.log {
missingok
notifempty
sharedscripts
postrotate
/etc/init.d/k3s --quiet --ifstarted restart || true
endscript
}# -d debug - 不会执行
logrotate -d /etc/logrotate.d/apache2.conf
# -v verbose - 会执行
logrotate -v /etc/logrotate.d/apache2.conf关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub1 条
- logrotate/logrotategithub.com/logrotate/logrotate
其他外链1 条
- pkgs.alpinelinux.org/contents?file=&path=%2Fetc%2Flogrotate.d&name=&branch=edge&arch=x86_64pkgs.alpinelinux.org/contents?arch=x86_64&branch=edge&file=&name=&path=%2Fetc%2Flogrotate.d