これは 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
手動で実行するだけで、文字通り5分以内に自分の質問に答えることができました: /usr/lib64/sa/sa2 -A
上記の cron ジョブを root として実行します。
将来誰かの役に立つかもしれないので、私の質問と回答を残しておきます。