Took me a while to figure out all the errors to get cron to run this correctly but it works now! Had to set some env variables.