Reputation: 381
Often when I update what's in my scheduled tasks, I need to remove what's already running. Is there a way to quickly remove them?
Currently I do this:
Find the task IDs with this: ps -fe | grep artisan
Kill the tasks like /usr/bin/php7.3 artisan command:my-commands-here and "sh -c ...etc.etc. artisan etc.etc" with a kill command like: kill 155431
Is there a linux command I can use to kill all "artisan command:XYZ" at once?
Upvotes: 0
Views: 2715
Reputation: 585
Use the below command. It will kill each process listed in artisan search list.
for pid in $(ps -fe | grep artisan); do kill $pid; done
Upvotes: 2