In one project I needed to run the Laravel’s queue:work command for sending emails on production. The problem was that sometimes it quit silently and emails were accumulating in database. To solve it you would probably install program like supervisord or similar.

But, the thing is that you don’t always have a possibility to install that program for example like when you are on hosting (my case). To solve this we can simply use bash script.

In this short article I wanted to share solution that I’m using so maybe someone will find it useful.