In my last post Ill explain how to run your PHP code every second using bash/shell script but once you close terminal it will terminate. Now if you want your script to run continuously in background you can run bellow command

Run shell script in background after terminal close

./myshellScript.sh &

To stop running shell script run bellow command

killall -9 myshellScript.sh

To check all running process run bellow command

ps aux | grep sh

Hope this command help you 🙂