Limit log size for ufw 限制 log 文件大小

There is separate daemon called logrotated that take care about rotating and deleting old logs. You should have config file for ufw in /etc/logrotate.d/ufw.

logrotate 是基于 cron 来运行的,其脚本是/etc/cron.daily/logrotate,实际运行时,Logrotate 会调用配置文件/etc/logrotate.conf。

然后我们看一下 ufw 的配置文件:

也就是默认自带有 logrotate 的功能,是 weekly 会 rotate 一次,4 表示只保留最近 4 周的 log。


  1. 被遗忘的 Logrotate
  2. Limit log sizes in particual ufw’s logs

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.