Search code examples
functionsymfonycronschedule

Launch Symfony 4 function like a cronjob (as ADMIN)


Is it possible (and what would be the most simple solution), to schedule (like a cronjob) the launch of symfony function ?

I would also need to secure it and launch then as an SUPER_ADMIN_USER of my website (using FOSUserBundle).

I saw that this is possible to integrate the unix cronjobs (but is there a solution inside symfony ?). Also I could not find information about the rights.


Solution

  • You could create a custom command and add it to the crontab.

    https://symfony.com/doc/current/console.html