The best way to do this would be to run a cron job (if you are on linux). It is basically a scheduling service that you can set to run a specific PHP page at a certain date/time interval. I use them a lot to automate various processes. Microsoft has the scheduler which is a windows equivilant.
Let me know if you need any help...