Updated run function for 5.6+

Based on code from http://www.concrete5.org/community/forums/usage/clear-cache-as-an-automated-job/