0

i have this shell command, i use it in the crontab

for i in {0..10};do /usr/bin/php5-cli -q /my/path/to/file.php --chunk $i;done  > /dev/null 2>&1

but each loop step is waiting the previous one to start, and each one takes 5 minutes so it will end after 25 minutes

is there any way to run all the 10 steps in one time? so the whole process will take just 5 minutes


I'm using http://php.net/manual/en/function.getopt.php for handling the command parameters

1
  • 1
    ssh and crontab are completely unrelated. Maybe you meant "shell" Commented Jun 4, 2016 at 13:10

1 Answer 1

3

You can run a command in the background simply by putting & sign after it

/usr/bin/php5-cli -q /my/path/to/file.php --chunk $i &
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.