sysstat 没有更新配置?

sysstat 没有更新配置?

这是我在 SuperUser 上的第一个问题,所以请放心!

我尝试通过将 /etc/sysconfig/sysstat 文件更新为以下内容来修剪服务器的 /var/log/sa/* 日志:

# sysstat-10.1.5 configuration file.

# How long to keep log files (in days).
# If value is greater than 28, then log files are kept in
# multiple directories, one for each month.
HISTORY=7

# Compress (using gzip or bzip2) sa and sar files older than (in days):
COMPRESSAFTER=1

# Parameters for the system activity data collector (see sadc manual page)
# which are used for the generation of log files.
SADC_OPTIONS="-S DISK"

# Compression program to use.
ZIP="gzip"

以前我的配置文件会保留 28 天的文件,每 31 天压缩一次(从不)。进行上述更新后,我运行了:

service sysstat restart

无济于事 – 我还注意到默认的 cron 作业位于:

/etc/cron.d/sysstat

内容如下:

# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A

我是否需要手动运行上述操作或等到明天?或者,这与我的重启和 cron 作业无关,这意味着我只需要手动删除不需要的 saDD/sarDD 日志?

干杯

答案1

通过简单手动运行:/usr/lib64/sa/sa2 -A,我在 5 分钟内就回答了自己的问题

以 root 身份执行上述 cron 作业。

我会留下我的问题/答案,因为它可能会在将来帮助到某些人。

相关内容