Remove 30 day old files from you GNOME trash

This was written and tested on Ubuntu 8.04 beta4

Removing 30 day old files from you gnome trash can be done with the following magic line:

find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

Now, what if you want to do this every day? Simple: add a crontab entry to do it all: run crontab -e and insert the following:
# m h  dom mon dow   command
MAILTO=""
@daily find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

If you do not have anacron, but the usual cron, then this may mean that you never run it, because it waits till midnight and you probably don't have you computer running then. So you may choose to run this every 3 hours, like so:
# m h  dom mon dow   command
MAILTO=""
0 */3 * * *    find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

And that should do the job.

Update: Changed -mtime 30 to -mtime +30 to delete all 30 day old and older files.