well a cron job would work
Do you have access to the CRON on your server?
If you do then you can create a PHP script that can be called via CRON
If you dont have access to the CRON on your server then you couls create a PHP script that will get called every time the Index page is losded, but thiw will add more overhead to your site.
I suggest that you create a CRON job to run a PHP script at a given off peek time daily.