1

I have three different crawler scripts that I want to run in parallel and I'm wondering what command do I use to execute all three at the same time.

I'm on a nix platform

2 Answers 2

3

if you're on a *nix platform, putting space ampersand ( & ) at the end of the command should put it in the background, giving you back your shell to run other commands. Obviously you want to make sure the output of the job goes to a file and not standard output (screen) or the output will get confusing between the various commands

Sign up to request clarification or add additional context in comments.

4 Comments

When I use the space & it kills the previous script??
No, it sends it to a background process. Doing this does not effect any other processes.
Some of the details differ depending on the shell, but the basics are the same across sh, bash, ksh. Here's the top Google search I found for a tutorial. Google is your friend. kb.iu.edu/data/afnz.html
Looks like ubuntu does not allow you to run a PHP script in the background.
1

An option is to run them in separate windows in screen. This will keep the output neatly compartmentalized, and you can disconnect from the screen leaving it in the background without interrupting the processes.

2 Comments

This is a little old, but I am looking for more details about your suggested solution. I like the idea of using multiple windows, but how can I write a script that when ran automatically opens a new window for each process? Using ubuntu. Basically I would run this one .sh script and it would spawn the window for each of the php processes I want running simultaneously.
@user658182: Running the shell script from within a screen session and prefixing each line with screen should do the job.

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.