当前,我有大约3.5GB的顶级日志文件
/var/log/atop/
我不需要那么多日志数据。
那里的档案早在28天前就有了。
我找不到一种方法来配置atop日志限制/配额/年龄。
如何降低磁盘空间的使用率?
发布于 2016-05-08 23:26:47
始终阅读man页面。一直都是。
通过运行man atop来做到这一点
如果你这么做的话,你就会看到:
When atop is installed, the script atop.daily is stored in the /etc/atop directory.
This scripts takes care that atop is activated every day at midnight to
write compressed binary data to the file /var/log/atop/atop_YYYYMMDD
with an interval of 10 minutes. Furthermore the script removes all raw
files which are older than four weeks. The script is activated via the cron
daemon using the file /etc/cron.d/atop with the contents
0 0 * * * root /etc/atop/atop.daily
When the RPM `psacct` is installed, the process accounting is automatically
restarted via the logrotate mechanism. The file
/etc/logrotate.d/psaccs_atop takes care that atop is finished just before
the rotation of the process accounting file and the file
/etc/logrotate.d/psaccu_atop takes care that atop is restarted again after
the rotation. When the RPM `psacct' is not installed, these logrotate-files
have no effect.发布于 2022-05-27 06:56:01
此解决方案适用于Ubuntu以及其他系统:
打开配置文件/etc/default/atop
它会看起来像这样
# /etc/default/atop
# see man atoprc for more possibilities to configure atop execution
LOGOPTS="-R"
LOGINTERVAL=10
LOGGENERATIONS=28
LOGPATH=/var/log/atopLOGGENERATIONS是将存储的历史记录天数(配置值由/usr/share/atop/atop.day读取,它将删除旧的日志文件)
您可以将LOGGENERATIONS更改为较小的天数。
发布于 2022-10-11 07:47:36
所有给定的答案在某个时候都是正确的,尽管atop似乎多次更改了配置文件的位置。正如@EEAA所建议的,请检查man atop以获得特定版本的配置位置。
对于我来说,在v2.7.1之上,配置位于/etc/default/atop下面,并提供了所有必要的信息。
https://serverfault.com/questions/775540
复制相似问题