/ var / log의 두 번째 로그 파일이 압축되지 않은 이유 syslog 등 로그 정보가 증가함에 따라

로그온 /var/log/(Debian / Ubuntu)은 다음과 같이 저장됩니다.

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

커널 로그, syslog 등

로그 정보가 증가함에 따라 모든 파일을 단일 파일로 유지하지 않고 작은 파일로 분할하여 저장합니다. 두 번째 파일 ( x.log.1)이 압축되지 않은 이유가 궁금합니다 . 최신 로그에 더 쉽게 액세스하는 것과 관련이 있습니까?



답변

최근 파일에보다 쉽게 ​​액세스 할 수 있어야한다는 데 동의합니다. 어쨌든 실제 동작은 logrotate ‘delaycompress’지시문을 통해 결정됩니다.

역사적인 이유는 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.


답변

그렇습니다. 최신 로그 파일에보다 쉽게 ​​액세스 할 수 있도록하기위한 것입니다. logrotate 옵션 delaycompress이이를 제어합니다. logrotate 맨 페이지에서 :

지연 압축

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

답변