Monday, July 9, 2012

Ubuntu Linux - Removing files based on date

A little script to remove files based on date.
This command will remove anything older then 30 days:
find /data/server/log/ -mtime +30 -exec rm {} \;

This command will remove anything over 1 year:
find /data/server/log/ -mtime +360 -exec rm {} \;


No comments:

Post a Comment

Phoenix

I am resurrecting this tech blog for notes related to Azure Logic Apps with SAP.