Create auto delete old files in the temp directories

Task: Create script which will delete old files in the temp directories

Solution:

find /home/scalan/tempo/30-days -name "*" -type f -mtime +30 -delete
find /home/scalan/tempo/60-days -name "*" -type f -mtime +60 -delete
find /home/scalan/tempo/90-days -name "*" -type f -mtime +90 -delete

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :