I've a cron will generate daily file with format like data.log.YYYYMMDD and I want to use logrotate only to delete those file older than 5 days.
I tried this but not work. Any idea? Thanks.
/log/data.log.* { daily missingok rotate 0 maxage 5 }
I've a cron will generate daily file with format like data.log.YYYYMMDD and I want to use logrotate only to delete those file older than 5 days.
I tried this but not work. Any idea? Thanks.
/log/data.log.* { daily missingok rotate 0 maxage 5 }
It's not (easily) feasible... take a look at these posts:
The most easy way to do that is just to make a cron task: see this example, basically something like:
$ /usr/bin/find /data/tier2/scripts/logs/ -mtime +7 -name "*.log" -print -exec /bin/rm {} \;