So, PHP is a language that only collects and processes the data providing a result, so it doesn’t have native cron functions and you shouldn’t even try to cheat it out of it. (That is, it processes the data it has to process and dies soon after)
Good, now your operating system is different, it can create check a file regularly(crontab) and perform certain instruction as it is specified.
Exemplifying:
# [Quando vai rodar] [Comando que vai rodar]
* 1 * * * php /var/www/site/public/index.php --module=z --action=y
That is, I specified that the command "/var/www/site/public/index.php --module=z --action=y" will run every day at 1 hr.
Finally, the configuration can change according to the operating system, so I recommend that you learn the concept (https://en.wikipedia.org/wiki/Cron) a cron, and apply as per your system.
How to schedule a recurring task on linux?
– rray
@rray I am not using Linux.
– PululuK
Prestashop’s cron module only works with linux natively. In windows it only works when being accessed after scheduling (the system checks whether past the date on access, and performs the tasks in positive case).
– Bacco