您的位置:首页 > 其它

Logrotate日志切割报错 文件不再同一个用户组下

2017-12-08 17:43 393 查看
分割日志时报错:

:error: skipping "/var/log/nginx/test.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.


xx 文件所属用户

添加“su root xx”到/etc/logrotate.d/nginx文件中即可

如下;

/var/log/nginx/*.log {
su root public
daily
missingok
rotate 52
compress
delaycompress
notifempty
#ifempty
create 0640 www-data adm
sharedscripts
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: