日志文件大小或年龄

我想更改各种日志文件(特别是auth.log)以保留过去30-90天内任何地方的信息。 现在它只有大约4天的信息。 如何通过GUI或命令提示符修改这些设置?

谢谢!

Ubuntu使用logrotate

您可以在/etc/logrotate.d配置

示例语法:

  /var/log/messages { rotate 5 weekly postrotate /usr/bin/killall -HUP syslogd endscript } 

完整配置选项请参阅:

http://manpages.ubuntu.com/manpages/precise/man8/logrotate.8.html

http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-ubuntu-part-1

http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-ubuntu-part-2