How to reduce database size

I’d like to know how to do this as well.

I want to create a category that auto deletes posts. The idea is to have a space where people can speak freely knowing that whatever they post will auto delete after a certain time i.e. for privacy reasons.

I have a category set to auto close topics after 168 hours.
Now I need to figure out how to delve into the DB (I expect a crontab task is the best way to do this) and delete any posts including uploaded images from the server that belong to this category and are auto closed.

How would I do that?