当前位置:网站首页>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
边栏推荐
猜你喜欢
How to install jsonpath package
Batch export ArcGIS attribute table
Resolve the error Max virtual memory areas VM max_ map_ count [65530] is too low, increase to at least [262144]
Closure type of rust (difference between FN, fnmut and fnone)
Vulnérabilité d'exécution de la commande de fond du panneau de commande JD - freefuck
PowerDesigner various font settings; Preview font setting; SQL font settings
C language loop structure program
SSD硬盘SATA接口和M.2接口区别(详细)总结
Win1远程出现“这可能是由于credssp加密oracle修正”解决办法
GDAL + ogr learning
随机推荐
Log4j2 cross thread print traceid
SSD硬盘SATA接口和M.2接口区别(详细)总结
7-21 wrong questions involve knowledge points.
word frequency count
Feign requests the log to be printed uniformly
positioner
Romance in C language
Robocode tutorial 3 - Robo machine analysis
Crack sliding verification code
C language loop structure program
Calculation of fishing net road density
xlsxwriter. exceptions. Filecreateerror: [errno 13] permission denied
Clion installation tutorial
C [file operation] read TXT text by line
Transfer learning of five categories of pictures based on VGg
【ACM】509. Fibonacci number (DP Trilogy)
深度学习经典网络解析目标检测篇(一):R-CNN
Climbing watermelon video URL
ArcGIS license error -15 solution
.105Location