logrotate cron job not rotating certain logs

后端 未结 6 943
生来不讨喜
生来不讨喜 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:43

    I've recently encountered a similar SELinux-related issue with logrotate not operating on files as expected, which occurred when the logs to be rotated were on an NFS share.

    In this case setting the logrotate_use_nfs seboolean seemed to fix the problem, e.g.

    $ setsebool logrotate_use_nfs 1
    $ getsebool logrotate_use_nfs
    logrotate_use_nfs --> on
    

提交回复
热议问题