Aqu*_*wer 8 log-files disk-space-utilization
目前我有 3.5GB 的顶部日志文件
/var/log/atop/
我不需要那么多日志数据。
那里的文件最早是 28 天前的。
我找不到配置atop
日志限制/配额/年龄的方法。
如何降低磁盘空间使用率?
小智 5
为我的版本添加答案(也在手册页中找到):
乌班图:17.04
$ 在 -V 之上
版本:2.2.6
该脚本位于: /usr/share/atop/atop.daily
我已经把我的日志减少到 7 天了。
38c38
< ( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )
---
> ( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +7 -exec rm {} \;)& )
Run Code Online (Sandbox Code Playgroud)
始终阅读该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.
Run Code Online (Sandbox Code Playgroud)