I wrote a very simple bash script to copy files in the trash can to a backup directory:
#!/bin/sh
# trashbackup.sh ; version 1.0
ditto ~/.Trash/ ~/.Trash_backup/
I invoke the script every 10 minutes via /etc/crontab, using this crontab entry: (I am the user bt):
# The periodic and atrun jobs have moved to launchd jobs
# See /System/Library/LaunchDaemons
#
# minute hour mday month wday who command
*/10 * * * * bt /Users/bt/app-unix-scripts/trashbackup.shI also invoke another small script that empties the .Trash_backup directory once a week. This could be done more often, or executed manually, if you trash a large amount of data. Nothing fancy, but I think it will same me some frustration in the future. Hopefully some of you might find it useful as well.
[robg adds: Note that this script will only handle items on your boot drive. If you have multiple partitions or drives, you'll have to get fancier with the code to backup the contents of the .Trashes folder on each volume.]

