当前位置:网站首页>Cutting permission of logrotate file
Cutting permission of logrotate file
2022-04-23 18:14:00 【The hunter is eating meat】
1、 Problem description
logrotate When cutting files , Report errors
[email protected] 11:04:53:/usr# logrotate -d /etc/logrotate.d/rsyslog
Error message :
rotating pattern: /var/log/syslog
after 1 days (14 rotations)
olddir is archive, empty log files are not rotated, old logs are removed
considering log /var/log/syslog
error: skipping "/var/log/syslog" 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. rotating pattern: /var/log/kern.log /var/log/auth.log weekly (14 rotations) olddir is archive, empty log files are not rotated, old logs are removed considering log /var/log/kern.log error: skipping "/var/log/kern.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.
considering log /var/log/auth.log
error: skipping "/var/log/auth.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.
2、 analysis
The error messages are the same , Pick out a paragraph , as follows :
error: skipping “/var/log/syslog” 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.
The main reason is the problem of permission , You need to specify the user or group to execute the script .
Actually , The solution is also given :
Set “su” directive in config file to tell logrotate which user/group should be used for rotation.
3、 resolvent
stay logrotate The configuration of , Specify users and groups ,su root root.
logrotate The full configuration is as follows :
/var/log/syslog
{
su root root # Designated user 、 Group
daily
rotate 14
missingok
notifempty
# delaycompress
# compress
dateext
dateformat -%Y-%m-%d
olddir archive
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
/var/log/kern.log
/var/log/auth.log
{
su root root # Designated user 、 Group
weekly
rotate 14
missingok
notifempty
# compress
# delaycompress
olddir archive
dateext
dateformat -%Y-%m-%d
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
版权声明
本文为[The hunter is eating meat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210611118454.html
边栏推荐
- C byte array (byte []) and string are converted to each other
- STM32学习记录0008——GPIO那些事1
- Cells in rust share variable pointers
- re正则表达式
- .104History
- According to the result set queried by SQL statement, it is encapsulated as JSON
- Permission management with binary
- Win1远程出现“这可能是由于credssp加密oracle修正”解决办法
- ArcGIS license error -15 solution
- powerdesigner各种字体设置;preview字体设置;sql字体设置
猜你喜欢

Dock installation redis

JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞

Transfer learning of five categories of pictures based on VGg

Installation du docker redis

Spark performance optimization guide

Qt读写XML文件(含源码+注释)
![[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)](/img/91/3272d5ad04cd1d8476c739546f4356.png)
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)

The vivado project corresponding to the board is generated by TCL script
![[UDS unified diagnostic service] v. diagnostic application example: Flash bootloader](/img/45/f9e24ae1c619f78aeeb7bcf12d6e5f.png)
[UDS unified diagnostic service] v. diagnostic application example: Flash bootloader

A few lines of code teach you to crawl lol skin pictures
随机推荐
【ACM】70. climb stairs
I/O多路复用及其相关详解
Crawler for querying nicknames and avatars based on qqwebapi
Secure credit
Robocode tutorial 3 - Robo machine analysis
硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
Docker 安裝 Redis
.104History
Arcpy adds fields and loop assignments to vector data
Log4j2 cross thread print traceid
C language to achieve 2048 small game direction merging logic
Climbing watermelon video URL
How to ensure the security of futures accounts online?
登录和发布文章功能测试
Matlab tips (6) comparison of seven filtering methods
Qtablewidget usage explanation
Robocode Tutorial 4 - robocode's game physics
Romance in C language
Linux installs MySQL in RPM (super simple)
Docker 安装 Redis