I'm running a server and needs to execute following command with the parameters. The scripts works great at the moment but the problem is when I run the script I cannot return back to the console. It keeps running in the console. If I stop it forcefully then the the process also going to stop.
I want to keep running the process and return to the console.
#!/bin/sh
php /home/stjc/app/artisan queue:listen --timeout=60 --tries=5
Thanks
Run that process in background:
#!/bin/sh
(php /home/stjc/app/artisan queue:listen --timeout=60 --tries=5) &
try adding an ampersand(&
) at the end with brackets on either side of original command.
Edit:
:
is a shell builtin which means NOP depending on your OS it might a problem try escaping the it in the php command and see if it works for you
#!/bin/sh
(php /home/stjc/app/artisan queue\:listen --timeout=60 --tries=5) &
also puting the full path to your php
interpreter is strongly advised.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With