logrotateが動いているか確認する方法をよく忘れるのでメモ。
環境はUbuntu
command
cat /var/lib/logrotate/status
logrotateをDryRunしたい場合
command
logrotate -d /etc/logrotate.d/nginx
result
reading config file /etc/logrotate.d/nginx
considering log /var/log/nginx/access.log
log does not need rotating
considering log /var/log/nginx/error.log
log does not need rotating
not running postrotate script, since no logs were rotated
not running last action script, since no logs will be rotated
目的のものを無理やりローテートさせるには、statusファイルの日付を前日などに書き換える。