One day i found that the Puppet master is running out of space and then i realize that there is a lot of run reports in YAML format located @ /var/lib/puppet/reports. I want to delete the old reports for releasing the disk space.
So i move to the /var/lib/puppet/reports directory and execute the following line to recursively remove any .yaml which is older than 14 days.
find $d -type f -name \*.yaml -mtime "+14" -exec rm -f {} \;
A few years ago i had a post about a housekeeping shell script which is quite similar to the above approach.
Done =)
Reference: Google Groups – Purge puppet’s reports
One thought on “Linux – Delete files which are older than N days”