在使用logrotate对nginx的日志进行分割的时候系统报错,error信息:
error: skipping "/var/log/nginx/access.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 used for rotation.
提示没有权限访问nginx/access.log,看过其他人遇到的情况,处理办法是在/etc/logrotate.d/nginx文件中添su root list,添加后的nginx文件:
/var/log/nginx/*.log {
su root list
daily
missingok
rotate 52
compress