-
[Linux] 리눅스 logrotate Error "error: skipping "/var/log/" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be usedError Handling 2024. 9. 12. 11:39반응형

해당 에러는 권한 설정 문제로 발생.
/etc/logrotate.d/ 디렉토리에 생성한 logrotate 파일의 내용에 su root root 를 추가해주면 에러를 해결할 수 있다.
/mnt/C/Users/user/Pipeline/mosquitto/mosquitto.log { su root root ### <--- 추가해줌 monthly rotate 6 compress delaycompress missingok notifempy create 640 mosquitto mosquitto }- daily, weekly, monthly: 로그 회전 주기를 설정합니다. daily는 매일, weekly는 매주, monthly는 매달 로그 파일을 회전합니다.
- rotate N: 로그 파일을 N개까지 유지합니다. 오래된 파일은 삭제됩니다.
- compress: 회전된 로그 파일을 압축하여 저장합니다.
- delaycompress: 가장 최근에 회전된 로그 파일은 압축하지 않고, 그다음 회전 시 압축됩니다.
- missingok: 로그 파일이 존재하지 않으면 오류 없이 무시합니다.
- notifempty: 로그 파일이 비어 있을 경우 회전하지 않습니다.
- create 640 user group: 새로운 로그 파일 생성 시 파일 권한과 소유자(유저 및 그룹)를 설정합니다.
반응형'Error Handling' 카테고리의 다른 글