Powerful wrapper for periodic tasks like cron jobs