[20211115]配置logrotate提示parent directory has insecure permissions.txt
--//今天在配置logrotate遇到一些问题,做一个记录。
# /usr/sbin/logrotate -d /etc/logrotate.d/oracle
rotating pattern: /u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.log weekly (5 rotations)
empty log files are not rotated, old logs are removed
considering log /u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.log
error: skipping "/u01/app/oracle/product/11.2.0.3/db_1/network/log/listener.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.
--//我开始以为是某个目录权限问题,上网查询,加入如下内容,问题解决。
su oracle oinstall
--//也可以加入如下。
su root root
--//我在想如何顺序查询目录的权限呢?简单写一行命令如下:
# cd / ;echo /u01/app/oracle/product/11.2.0.3/db_1/network/log | sed 's+/+\n+g' | xargs -IQ echo "ls -ld Q;cd Q" | bash
drwxr-xr-x. 4 root root 31 Feb 3 2021 u01
drwxr-xr-x. 5 root root 51 Aug 17 16:56 app
drwxrwxr-x. 10 oracle oinstall 143 May 19 09:02 oracle
drwxr-xr-x. 4 oracle oinstall 36 May 17 18:15 product
drwxr-xr-x. 3 oracle oinstall 18 May 17 18:15 11.2.0.3
drwxr-xr-x. 73 oracle oinstall 4096 Nov 2 09:37 db_1
drwxr-xr-x. 11 oracle oinstall 117 May 17 18:23 network
drwxrwx---. 2 oracle oinstall 26 Nov 15 08:47 log
--//这样就可以顺序看到各个目录的权限。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/267265/viewspace-2842141/ ,如需转载,请注明出处,否则将追究法律责任。