Cron Job to remove all Files older than a Specific Amount of days

In this example I’m using 90 days. But you can use whatever you would like in the place of it. It’s also set to run at the first of every month.

0 0 1 * * find /home/somehomedir/thatfolderyouwanttouse/ -type f -mtime +90 -exec rm {} +

 

Leave a Reply