Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

SSH2 simultaneous connections

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

SSH2 simultaneous connections

Postby hifake » Wed Nov 30, 2011 4:46 pm

Hi,

I have to run a command in multiple servers simultaneously and get the results.
Is there a way to go to the next line in php before the current line completes execution?

$command = "grep foo /bar/*";
foreach ($servernames as $host) {
$stream = $objRx->exec_command($host, $command);
}

My objRx connects to the server using the host passed.

I have 3 servers in $servernames array. The command gets executed one server at a time. Since the search file is too large this takes a lot of time if I make one connection at a time.

Thanks!
hifake
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Nov 30, 2011 4:38 pm

Re: SSH2 simultaneous connections

Postby egami » Thu Dec 01, 2011 6:37 am

User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2197
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT


Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.