logrotate cron job not rotating certain logs

后端 未结 6 1070
生来不讨喜
生来不讨喜 2021-02-05 14:01

I added two scripts in \"logrotate.d\" directory for my application logs to be rotated. This is the config for one of them:

 {
  compress
           


        
6条回答
  •  不要未来只要你来
    2021-02-05 14:38

    I have seen this issue with SELINUX disabled and this was because the parent directory of log file being rotated has global write-permission which is not welcomed by logrotate

    error: skipping "/xxx/yyy/log/logfile.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.
    

    chmod the parent directory to 755 solved the issue

    # logrotate --version
    logrotate 3.8.6
    

提交回复
热议问题