Posts

Showing posts from June, 2021

How to schedule a Symfony Console App execition using supervidord? Not using cron job

Image
Introduction Scheduling a periodic execution of a Symfony command is a commonly used task. The jobs to be scheduled are diverse, either performing inspections of fields into a databse, sending email notifications to certain recipients on certain days within the week, scanning parameters at certain hours every specific days into the week and ... a long etc.  Problem    How to schedule a weekly Symfony command execution ? Solutions Cron job : Often this kind of situations are performed by using a cron job.  It's easy to implement but has some downsides. Let's consider the following failure scenarios: The cron job fails at the moment of the execution for any reason. The executed task throws an exception at the same time the cron job is configured to execute. For those cases, the task would not be run again until the next week, leaving the data unprocessed for 15 days.  Supervisord An alternative is to create a mechanism, simil