/var/logの2番目のログファイルが圧縮されていないのはなぜですか?

/var/logの2番目のログファイルが圧縮されていないのはなぜですか?

(Debian / Ubuntu)ログは/var/log/次のように保存されます。

x.log
x.log.1
x.log.2.gz
...

カーネルログ、システムログなど

私はログ情報が大きくなるにつれて(すべてを1つのファイルに保存するのではなく)、より小さなファイルに分割して保存することを発見しました。 2番目のファイル(x.log.1)がなぜ圧縮されていないのか知りたいのですが。これは、最新のログにアクセスしやすくすることができますか?

ベストアンサー1

同意します。これにより、最近のファイルにアクセスしやすくなります。とにかく、実際の動作は、delaycompress次のようなlogrotateディレクティブによって決定されます。

回転するときはファイルを圧縮せず、次に圧縮してください

歴史的な理由は logrotate マニュアルで見つけることができます:

Postpone  compression of the previous log file to the next rotation 
cycle.  This has only effect when used in combination  with compress. 
It can be used when some program can not be told to close its logfile and 
thus might continue writing to the  previous log file for some time.

おすすめ記事