I need to create a bash script that deletes all files older than N days in downloads
folder but would exclude all files in archive
sub-folder. My folder structure is like this:
downloads/
user1_folder/
archive/
user2_folder/
archive/
...
Based on this Q&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 archive
subfolders.
#!/bin/bash
find ./downloads -mtime +32 -type f -delete