Deleting logs older than nnn days

From Tech-Wiki
Revision as of 23:35, 10 July 2016 by Fabricio.Lima (Talk | contribs) (Created page with "In order to delete log files older than one year (you can adjust this value below) just edit your crontab and add: 0 0 1 1 * find $FWDIR/log/ -mtime +365 -exec rm -f {} \...")

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

In order to delete log files older than one year (you can adjust this value below) just edit your crontab and add:


0 0 1 1 *   find $FWDIR/log/ -mtime +365 -exec rm -f {} \;

This way, on January 1st, it will delete the files from the previous year (not the one that has just ended :)