Originally Posted by
ActionParsnip
Doesn't logrotate do this automatically??
It does, however I believe the parameter in logrotate to delete old logs is set to not delete any old logs until the archived logs accumilated reach an astounding amount of disk space usage.
It can be reconfigured in logrotate.d.
I believe that's the file name where it can be reconfigured to delete old archived logs after a certain amount of time.
But I'm not too certain if logrotate deals with the 2 command lines
Code:
find /var/log -type f -regex ".*\.[0-9]$" | xargs rm -Rf
find /var/log -type f -regex ".*\.old" | xargs rm -Rf