A timer script that runs every X duration. Or, cron scripts for Python.