Delete files older than x days

From Tech-Wiki
Revision as of 17:30, 23 February 2020 by Fabricio.Lima (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


To exclude files older than 30 days:

find /var/log -type f -name '*.log' -mtime +30 -exec rm -f {} \;