Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the best-selling Take Control ebooks.

Clean Up Messy Folders with Hazel

Send Article to a Friend

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.)

#!/bin/bash
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.

 

READERS LIKE YOU! Support TidBITS by becoming a member today!
Check out the perks at <http://tidbits.com/member_benefits.html>
Special thanks to Paul Taylor, Mark Snyder, Tom Fritz, and John Yaeger
for their generous support!