
이 특정 파일이 왜 회전되지 않는지 잘 모르겠습니다. 디렉토리가 아닙니다. 어떤 아이디어가 있나요?
방화벽 파일의 크기:
$ ls -alh /var/log
-rw-r--r--. 1 root root 134M Jan 31 13:49 firewalld
/etc/logrotate.conf의 관련 스탠자:
/var/log/firewalld {
hourly
copytruncate
maxsize 1M
missingok
rotate 8
compress
notifempty
nomail
noolddir
}
실행된 명령은 다음과 같습니다.
$ sudo logrotate -fv /etc/logrotate.conf
rotating pattern: /var/log/firewalld forced from command line (8 rotations)
empty log files are not rotated, log files >= 1048576 are rotated earlier, old logs are removed
No logs found. Rotation not needed.
set default create context
결과적으로 방화벽 파일의 크기는 다음과 같습니다.
$ ls -alh /var/log
-rw-r--r--. 1 root root 134M Jan 31 13:49 firewalld
답변1
이 게시물에서 답을 찾았습니다.https://stackoverflow.com/posts/43398163/timeline
분명히 -v 스위치는 -n 스위치와 동일합니다. 즉, v-switch는 실제로 logrotate가 로그를 회전하는 것을 허용하지 않습니다.