当前位置:网站首页>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
边栏推荐
- JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞
- Closure type of rust (difference between FN, fnmut and fnone)
- Implementation of k8s redis one master multi slave dynamic capacity expansion
- Calculation of fishing net road density
- Visualization of residential house prices
- idea中安装YapiUpload 插件将api接口上传到yapi文档上
- Using transmittablethreadlocal to realize parameter cross thread transmission
- Rust: how to match a string?
- ArcGIS table to excel exceeds the upper limit, conversion failed
- String function in MySQL
猜你喜欢
JD-FreeFuck 京东薅羊毛控制面板 后台命令执行漏洞
String function in MySQL
[UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
由tcl脚本生成板子对应的vivado工程
函数递归以及趣味问题的解决
Robocode tutorial 3 - Robo machine analysis
The vivado project corresponding to the board is generated by TCL script
Data stream encryption and decryption of C
Batch export ArcGIS attribute table
解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
随机推荐
ArcGIS table to excel exceeds the upper limit, conversion failed
Nodejs installation
A few lines of code teach you to crawl lol skin pictures
Using transmittablethreadlocal to realize parameter cross thread transmission
C language loop structure program
Robocode tutorial 5 - enemy class
What are the relationships and differences between threads and processes
Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
Scikit learn sklearn 0.18 official document Chinese version
C language to achieve 2048 small game direction merging logic
NVIDIA Jetson: GStreamer and openmax (GST OMX) plug-ins
函数递归以及趣味问题的解决
idea中安装YapiUpload 插件将api接口上传到yapi文档上
Pyppeter crawler
PowerDesigner various font settings; Preview font setting; SQL font settings
[UDS unified diagnostic service] (Supplement) v. detailed explanation of ECU bootloader development points (2)
Romance in C language
proxy server
Excel opens large CSV format data
re正则表达式