Mysql auto update?

Ok how to put this.

Say you have a forum with millions of posts. When a post is six months old you want it deleted.

A. [COLOR=Blue]You make a sript you can run from the admin pannel, log in once a day and run it manually.[/COLOR]

**B. **[COLOR=SeaGreen]Put that script on the home page. Have it check the date the script was last run against todays date. And only run it if it hasn’t be run before.[/COLOR]

[COLOR=SeaGreen] (so only 1 user a day will have it check through millions of posts rather than every visitor)[/COLOR]

**C. **[COLOR=Purple]??? This is what I want to know, is there a better way of doing this. Does Mysql have a function to run scripts on a periodic basis without user intervention.[/COLOR]

Is there say a bin that you can get it to check at midnight every night and run whatever scripts are in there ?

Thanks for any tips.