이 절차로 작성되는 LDIF 스크립트는 오류 로그에 대해 다음 규칙을 설정합니다.
로그는 매주 회전됩니다.
로그 파일 수를 최대 30개로 유지하고각 파일의 크기는 최대 500MB를 넘지 않도록 합니다.
3개월 이상 된 로그 파일은 만료됩니다.
빈 디스크 공간이 500MB 미만이 되면 가장 오래된 로그를 삭제합니다.
모든 로그 파일은 최대 20,000MB의 디스크 공간을 사용합니다.
스크립트를 만들어 오류 로그를 관리합니다.
다음 내용이 있는 /var/tmp/logs-error.ldif 파일을 만듭니다.
dn: cn=config changetype: modify replace: nsslapd-errorlog-logging-enabled nsslapd-errorlog-logging-enabled: on - replace: nsslapd-errorlog-logexpirationtime nsslapd-errorlog-logexpirationtime: 3 - replace: nsslapd-errorlog-logexpirationtimeunit nsslapd-errorlog-logexpirationtimeunit: month - replace: nsslapd-errorlog-logrotationtime nsslapd-errorlog-logrotationtime: 1 - replace: nsslapd-errorlog-logrotationtimeunit nsslapd-errorlog-logrotationtimeunit: week - replace: nsslapd-errorlog-maxlogsize nsslapd-errorlog-maxlogsize: 500 - replace: nsslapd-errorlog-maxlogsperdir nsslapd-errorlog-maxlogsperdir: 30 - replace: nsslapd-errorlog-logmaxdiskspace nsslapd-errorlog-logmaxdiskspace: 20000 - replace: nsslapd-errorlog-logminfreediskspace nsslapd-errorlog-logminfreediskspace: 500 |
스크립트를 실행합니다.
# ldapmodify -h localhost -D 'cn=directory manager' -f /var/tmp/logs-error.ldif |
프롬프트에 대답합니다.
Enter bind password: Type the appropriate password modifying entry cn=config |