naneri
naneri

Reputation: 3971

How can I run multiple Laravel commands simultaneously?

I need to run the same Laravel command with different parameters 20 times simultaneously, how can I automate this? It is like: php artisan do-command 1, php artisan do-command 2,php artisan do-command 3, ... php artisan do-command 20? Also, will my laptop with i7-7500u and 8gb of ram enough to run 20-100 processes?

!!!UPDATE!!!

after the first answer i created an sh file:

 #!/bin/bash

 for i in {1..20}
    php artisan do-command $i &

but it throws an error syntax error near unexpected token "php"

Upvotes: 1

Views: 2068

Answers (1)

meysam
meysam

Reputation: 1794

On Linux you can add & to end of the command for running a command on the background, for example

for i in {1..20} do
    artisan do-command $i &
done

Upvotes: 1

Related Questions