Functions edited to create a cronjob php script.