Maintenance Script Help

You might try running it from the command line and scheduling it in cron.