Logrotate to clean up date stamped files

后端 未结 6 1099
梦谈多话
梦谈多话 2021-01-31 17:22

I\'m currently trying to work out a method of tidying up Oracle Recover log files that are created by Cron...

Currently, our Oracle standby recover process is invoked b

6条回答
  •  耶瑟儿~
    2021-01-31 18:04

    (Updated) Your options are:

    • As Satish answered, abandon logrotate and put a find script in cron
    • You could even, use logrotate and put a find script in the postrotate command

    Initially, I thought that changing the dateformat to match your logs might work but as Reid Nabinger pointed out the date format was not compatible with logrotate anyway. Recently, I tried to configure the same thing but for Java rotated logs that I wanted logrotate to delete. I tried the configuration below but it kept trying to delete all logs

    /opt/jboss/log/server.log.* {
        missingok
        rotate 0
        daily
        maxage 30
    }
    

    I ended up just implementing what Satish suggested - a simple find with rm script in cron.

提交回复
热议问题