I wrote a ruby script to provide this kind of functionality and it's pretty damn easy to use. All configuration is done in the script itself and all you need to do is have ruby/dbi installed and schedule the script. Here's a sample to get you going. Be sure to replace the references to $global accordingly.
Code:
require "date"
require "dbi"
require "logger"
require "../../globals"
...