Deleting old log files

Posted May 8th, 2010 in Bread-crumbs and tagged by Tobias

If you need to create a script to delete old logs based on number of days, you can use this:


find /path/to/logs/ -mtime +90 | xargs rm -rf

…and that’ll remove any thing older than 90 days.

Comments are closed.