define end time as yesterday to use that script in a cron