Jun 19, '07 07:30:00AM • Contributed by: JWiegley
This script is designed to be very efficient to run, so I run it hourly. There is not (yet) any provision for maintaining the Trash at a particular size. I recommend adding a line to your cron file like this:
@hourly python /your/path/to/dirscan.py
This will clean things out after a week, and checks each hour for new items to remove. It pays attention only to top-level entries within .Trash, so any directories you put in the trash will be deleted automatically.
[robg adds: The code download link is from the author's site, and will be the best place to grab the latest version of the script. I mirrored the source as of today on macosxhints.com, just in case the parent site goes away at some point. Note that I haven't tested this one. Finally, for those interested in a size-limited trash can, this hint and the associated comments offer a few solutions.]
