title: Bash script that deletes files older than N days but excludes files in certain folder
body: <p>I need to create a bash script that deletes all files older than N days in <code>downloads</code> folder but would exclude all files in <code>archive</code> sub-folder. My folder structure is like this:</p>
  
  <pre><code>downloads/
     user1_folder/
        archive/
     user2_folder/
        archive/
     ...
  </code></pre>
  
  <p>Based on <a href="https://stackoverflow.com/questions/13489398/delete-files-older-than-10-days-using-shell-script-in-unix">this Q&amp;A</a> I was able to create script that finds and deletes files older than N days, but I would like to exclude all files in <code>archive</code> subfolders.</p>
  
  <pre><code>#!/bin/bash
  find ./downloads -mtime +32 -type f -delete
  </code></pre>