my thought is to: first, immediately fire a command to every one of them at once, asking every one of them at once to cvs update themselves and then to send back a notification, of success or of failure, by some appropriate means.... heck, maybe you literally use e-mail to do it.
But now you're inventing a new process.
He already has a process. One that works. Whatever mechanisms he uses -- he mentions a "shell script" which generally means invoking one or more executables -- it currently does one at a time and waits for the process to finish logging the progress as it goes and the checking the log locally for errors.
Whilst kicking the jobs off in parallel using '>logN &' is a very simple extension of what he has now, it has the caveat of now needing to institute some mechanism by which it can wait for all the jobs to finish so the logs can be checked; or add the checking into each of the background processes plus some mechanism for notification of failures; etc. etc.
Alternatively, it is easy to convert most most existing shell scripts to Perl scripts. That's the basic raison d'etre for Perl's existence. It is easy to envisage his current shell script looking something like (ignore the syntax, csh isn't my thing):
foreach $webserver ( `cat servers` ) {
$result = `ssh server cvs update ... `;
if( echo $result | grep Error ) {
echo 'problem with server $webserver'
}
}
and easily converting that to something like: #! perl
my @webservers = <>;
for my $job ( @webserver ) {
my $result = `ssh $job cvs update ...`;
print "Server $job had errors" if $result =~ m[Error];
}
And it is a trivial extension of that, to do the same thing concurrently using threads: #! perl
use threads;
my @webservers = <>;
my @threads;
for my $job ( @webserver ) {
push @threads, async{
my $result = `ssh $job cvs update ...`;
print "Server $job had errors" if $result =~ m[Error];
};
}
$_->join for @threads.
It's just the path of least resistance really.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
|