/var/log/messages ファイルをローテートする
デフォルトでは、crond デーモンは /etc/cron.daily ですべてのスクリプトを実行します。そのうちの 1 つが logrotate です。
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
