title: Housekeeping reports with shell script
body: <p>I am working with an application that creates fresh reports every half hour and there is a requirement to do housekeeping to clear down the files.</p>
  
  <p>Different type of reports are created and persisted in directories as follows:</p>
  
  <pre><code>/home/myapp/reports/report1/
  /home/myapp/reports/report2/
  /home/myapp/reports/report3/
  /home/myapp/reports/report4/
  </code></pre>
  
  <p>There is requirement to housekeep and delete files older than lets say 3 days in all the above directories. Instead of writing a line of script for each directory e.g. </p>
  
  <pre><code>find /home/myapp/reports/report1/ -type f -mtime +3 -delete
  find /home/myapp/reports/report2/ -type f -mtime +3 -delete
  find /home/myapp/reports/report3/ -type f -mtime +3 -delete
  </code></pre>
  
  <p>Is there a way I can write a generic one that will support future additional type of reports as well as those above? How would this look like? What if older than days is different for each report type and not 3 days for all? </p>