0
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

logrotateが動いてるのか確認したいときに実行するコマンド

Posted at

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ファイルの日付を前日などに書き換える。

0
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?