Fwd: Re: parallel bash scripts

2012-03-28 Thread Mark LaPierre
Hi mark. I have a series of php apps that are async, and modify different tbls within a mysql db. The php apps also perform other tasks as well. The process needs to be able to periodically run the php apps. The shell scripts are used to run the individual php apps. During testing, I wanted to

Re: parallel bash scripts

2012-03-28 Thread Mark LaPierre
On 03/27/2012 10:35 PM, bruce wrote: Hi mark. I have a series of php apps that are async, and modify different tbls within a mysql db. The php apps also perform other tasks as well. The process needs to be able to periodically run the php apps. The shell scripts are used to run the individual

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Mark LaPierre
I solved a similar problem by installing gnu parallel on my system. It did everything that I wanted, and better than I would have coded. Ali On Tue, Mar 27, 2012 at 6:37 PM, Mark LaPierre marklap...@aol.com wrote: Check out the redirection at the end of each command. 12 redirects the

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Paul Allen Newell
On 3/28/2012 4:39 PM, Mark LaPierre wrote: On Tue, Mar 27, 2012 at 6:37 PM, Mark LaPierre marklap...@aol.com wrote: Check out the redirection at the end of each command. 12 redirects the standard out of your child command to the standard error which then appears in the parent shell. Is

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Ed Greshko
On 03/29/2012 11:15 AM, Paul Allen Newell wrote: On 3/28/2012 4:39 PM, Mark LaPierre wrote: On Tue, Mar 27, 2012 at 6:37 PM, Mark LaPierre marklap...@aol.com wrote: Check out the redirection at the end of each command. 12 redirects the standard out of your child command to the standard

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Paul Allen Newell
On 3/28/2012 8:27 PM, Ed Greshko wrote: On 03/29/2012 11:15 AM, Paul Allen Newell wrote: On 3/28/2012 4:39 PM, Mark LaPierre wrote: On Tue, Mar 27, 2012 at 6:37 PM, Mark LaPierremarklap...@aol.com wrote: Check out the redirection at the end of each command. 12 redirects the standard out

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Ed Greshko
On 03/29/2012 11:33 AM, Paul Allen Newell wrote: I've done enough googles to be pretty certain I was right (as your link does confirm), but I was asking for a confirm of what knew. Too much reading this thread of 21 and making myself confused. That being said, your suggested link does give

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Paul Allen Newell
On 3/28/2012 8:43 PM, Ed Greshko wrote: On 03/29/2012 11:33 AM, Paul Allen Newell wrote: I've done enough googles to be pretty certain I was right (as your link does confirm), but I was asking for a confirm of what knew. Too much reading this thread of 21 and making myself confused. That

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Ed Greshko
On 03/29/2012 11:47 AM, Paul Allen Newell wrote: I apologize for taking up the bandwidth by asking, Yeah, it does some like a waste of bandwidth to ask questions to which you already know the answer and then have it read by hundreds of people that may feel they want to answer and

Re: [CentOS] parallel bash scripts

2012-03-28 Thread Paul Allen Newell
On 3/28/2012 8:53 PM, Ed Greshko wrote: On 03/29/2012 11:47 AM, Paul Allen Newell wrote: I apologize for taking up the bandwidth by asking, Yeah, it does some like a waste of bandwidth to ask questions to which you already know the answer and then have it read by hundreds of people that may

parallel bash scripts

2012-03-27 Thread bruce
hi. got a couple of test bash scripts. dog.sh, cat.sh each script runs the underlying php in an endless loop. I'm trying to figure out how to run the scripts in parallel, from the same parent shell script. something like: test.sh dog.sh 2 cat.sh 2 where dog.sh would be :

Re: parallel bash scripts

2012-03-27 Thread Mateusz Marzantowicz
W dniu 27.03.2012 23:25, bruce pisze: hi. got a couple of test bash scripts. dog.sh, cat.sh each script runs the underlying php in an endless loop. I'm trying to figure out how to run the scripts in parallel, from the same parent shell script. something like: test.sh dog.sh 2

Re: parallel bash scripts

2012-03-27 Thread bruce
HI Mateusz Yeah, tried the basic ... but the issue is the shell scripts run as infinite loops.. and therefore, the dog.sh doesn't really exit/complete. So I can't really run them sequentially. If I open up separate term/windows, then of course, I can manually run them (one in each window)..

Re: parallel bash scripts

2012-03-27 Thread Dave Ihnat
On Tue, Mar 27, 2012 at 05:25:56PM -0400, bruce wrote: got a couple of test bash scripts. ... I'm trying to figure out how to run the scripts in parallel, from the same parent shell script. something like: Have you tried nohup cat.sh 21 nohup dog.sh 21 Cheers, -- Dave Ihnat --

Re: parallel bash scripts

2012-03-27 Thread bruce
hey dave... anyway i can redirect the err/out to the stdout.. instead of the nohut.out file?? it appears that the processes are running in the ps tb.. the nohut.out file also has input/data.. i'd like to be able to see the output of the processes scroll on the term/screen if possible thanks

Re: parallel bash scripts

2012-03-27 Thread Dave Ihnat
On Tue, Mar 27, 2012 at 06:06:56PM -0400, bruce wrote: anyway i can redirect the err/out to the stdout.. instead of the nohut.out file?? The usual way would be to do a tail -f on the output file, e.g., nohup cat.sh 21 cat.log tail -f cat.log If you're using bash, IIRC, you could reap the

Re: parallel bash scripts

2012-03-27 Thread bruce
dave.. thanks. but the script is a long running script, and i want to see the output as the script is running without having to hit the keyboard.. so doing a tail of the file while the process is running isn't what i'm looking for. anything else? thanks On Tue, Mar 27, 2012 at 7:00 PM, Dave

Re: parallel bash scripts

2012-03-27 Thread Rick Stevens
On 03/27/2012 04:06 PM, bruce wrote: dave.. thanks. but the script is a long running script, and i want to see the output as the script is running without having to hit the keyboard.. so doing a tail of the file while the process is running isn't what i'm looking for. anything else? The

Re: parallel bash scripts

2012-03-27 Thread suvayu ali
On Wed, Mar 28, 2012 at 01:06, bruce badoug...@gmail.com wrote: but the script is a long running script, and i want to see the output as the script is running without having to hit the keyboard.. I'm not sure what you mean. Do you mean to say you want to run the script and start seeing the

Re: parallel bash scripts

2012-03-27 Thread Mark LaPierre
On 03/27/2012 05:25 PM, bruce wrote: hi. got a couple of test bash scripts. dog.sh, cat.sh each script runs the underlying php in an endless loop. I'm trying to figure out how to run the scripts in parallel, from the same parent shell script. something like: test.sh where dog.sh would be :

Re: parallel bash scripts

2012-03-27 Thread bruce
hey rick... haven't talked to you in a very long time! -- i tried the nohup, but couldn't get it to work because of the fact that my processes have infinite loops.. so my test never got beyond running the 1st test shell script that's running an infinite loop... i can do a paste of what i'm

Re: parallel bash scripts

2012-03-27 Thread Mark LaPierre
On 03/27/2012 09:37 PM, Mark LaPierre wrote: Check out the redirection at the end of each command. 12 redirects the standard out of your child command to the standard error which then appears in the parent shell. At the end the last launches your command into a background shell and then moves

Re: parallel bash scripts

2012-03-27 Thread Mark LaPierre
I don't understand what you are trying to do. Do you want to run these commands in series? Run one, wait for it to complete, then start the other? If that's where you want to go then leave off the trailing ampersand but keep the redirection. The output of the first program will appear in

Re: parallel bash scripts

2012-03-27 Thread Cameron Simpson
On 27Mar2012 17:56, Rick Stevens rstev...@corp.alldigital.com wrote: | On 03/27/2012 04:06 PM, bruce wrote: | The problem is that a script wants a stdin, stdout and stderr. No evidence so far that they use stdin. | If | you're going to run them in parallel, you can't very well have both |