Skip to content
Thoughtful, detailed coverage of everything Apple for 34 years
and the TidBITS Content Network for Apple professionals

Clean Up Messy Folders with Hazel

I recently wrote about how keeping backups in BBEdit saved my bacon during a recent server crash (see “BBEdit 8.7.1 Adds Features, Fixes Bugs, Saves Data,” 2007-11-08). I ended the piece by commenting that I hadn’t realized I was storing over 17,000 files in that BBEdit Backups folder, so I trashed everything from before 2007.

After reading about my situation, Chris Owen of Hubris Communications wrote to tell me about a short cron script he runs every night on his BBEdit backups directory to delete all files older than six months, plus files older than 30 days that are also greater than 500K in size. For those who are or wish to become cron-savvy, here’s what Chris sent me. (Modifying this script to work on machines other than Chris’s is left as an exercise to the reader.)


find /Temp/Backups/ -mtime +180 -exec rm {} \;

find /Temp/Backups/ -size +500 -mtime +30 -exec rm {} \;

I thought Chris’s point was brilliant, but I didn’t have time to wade through the Unix man pages to figure out how to set up a cron script. Besides, I’ve been looking for uses for Noodlesoft’s Hazel, a snazzy little utility that watches specified folders and does things with the contents when your criteria are matched.

After 30 seconds of work in the Hazel preference pane to implement both of Chris’s rules, my BBEdit Backups folder was cleaner than ever. And thanks to Hazel’s constant lookout, I don’t have to worry about that folder’s contents growing out of control any more.

Needless to say, Hazel can match files on a wide variety of conditions, and it can do a lot more than just move files to the Trash. See the screenshot for the conditions and actions menus, which list all the possibilities.

For anyone who finds themselves needing to manage a regular influx of files – whether that management involves deleting, renaming, importing into iPhoto, or whatnot – Hazel is the easiest method I know about. Hazel 2.1.1 costs $21.95 and is available for 14-day trial; it’s a 1.6 MB download and requires Mac OS X 10.4 Tiger or Mac OS X 10.5 Leopard.

Subscribe today so you don’t miss any TidBITS articles!

Every week you’ll get tech tips, in-depth reviews, and insightful news analysis for discerning Apple users. For over 33 years, we’ve published professional, member-supported tech journalism that makes you smarter.

Registration confirmation will be emailed to you.

This site is protected by reCAPTCHA. The Google Privacy Policy and Terms of Service apply.