![Logrotate가 createolddir 옵션을 인식하지 못합니다(Debian)](https://linux55.com/image/131508/Logrotate%EA%B0%80%20createolddir%20%EC%98%B5%EC%85%98%EC%9D%84%20%EC%9D%B8%EC%8B%9D%ED%95%98%EC%A7%80%20%EB%AA%BB%ED%95%A9%EB%8B%88%EB%8B%A4(Debian).png)
나는 logrotate가 로그 폴더를 동적으로 정리하는 데 매우 유용한 createolddir 명령을 발견했으며 다른 데비안 서버에서도 문제 없이 성공적으로 작동합니다.
하나의 서버에 대해서만 Debian 8로 새로 설정하고 모든 업데이트가 완료되면 logrotate는 createolddir에 대해 다음과 같은 이상한 오류를 발생시킵니다.
root@localhost:~# logrotate -d /etc/logrotate.d/fail2ban
reading config file /etc/logrotate.d/fail2ban
error: /etc/logrotate.d/fail2ban:9 unknown option 'createolddir' -- ignoring line
olddir is now /var/log/x_old_logs/fail2ban_old_logs/
error: /etc/logrotate.d/fail2ban:19 error verifying olddir path /var/log/x_old_logs/fail2ban_old_logs/: Datei oder Verzeichnis nicht gefunden
removing last 1 log configs
Fail2ban 파일은 /etc/logrotate.d/fail2ban
다음과 같습니다:
/var/log/fail2ban.log {
weekly
rotate 4
compress
delaycompress
missingok
createolddir
olddir /var/log/x_old_logs/fail2ban_old_logs/
postrotate
fail2ban-client flushlogs 1>/dev/null
endscript
# If fail2ban runs as non-root it still needs to have write access
# to logfiles.
# create 640 fail2ban adm
create 640 root adm
}
나는 또한 그 옵션을 시도했는데 createolddir 644 root root
결과는 동일했습니다.
권한은 모두 순서대로 되어 있습니다. 이 문제를 해결하고 logrotate가 createolddir 명령을 인식하도록 만드는 방법을 모르겠습니다.
답변1
Debian 8(Jessie)(버전 3.8.7)에서는 지원 되지 logrotate
않습니다 .createolddir
logrotate(8)
수동귀하의 시스템에서.
Debian 9(Stretch)에는 logrotate
버전 3.11.0이 포함되어 있습니다.하다지원하다 createolddir
.