Bennett,

Thanks! I stole the fork/open/wait stuff from your multicmd program
(and from similar suggestions from Martin and James) and it works
great!

eric
(happily rsyncing/logging to multiple hosts in parallel)


Bennett Todd wrote:
> 
> 2000-09-20-22:53:53 Eric Whiting:
> > I have used the shell redirection stuff to capture stdout/stderr from
> > programs. But this time I'm trying to do a parallel rsync from a single
> > server to multiple clients all at the same time. The server has 2G RAM
> > and can handle the concurrent rsyncs.
> >
> > My problem is probably a perl programming problem and not a rsync one,
> > but the 'log' feature in rsync would help me a lot.
> 
> It's really easy to do this from perl.
> 
> > The perl 'open' command is really a popen system call that starts
> > a child process to handle the rsync.
> 
> That's actually an oversimplification, perl's open() builtin can do
> forks, execs, file descriptor rearranging, popen, plain file opens,
> all kinds of goo.
> 
> > The reason I wanted to use the rsync logfile feature is it seems the
> > children and parent all share the same stdout and the individual '>>'s
> > don't catch the right output. If I start a parallel rsync to 8 hosts,
> > all the stdout gets mangled.
> 
> It's really easy to redirect them just re-open the descriptors onto
> files in a child process.
> 
> I attach the multicmd script I've been using for some years now for
> running programs in parallel; it has an option to route the stdout
> and stderr from each child into a separate logfile.
> 
> -Bennett
> (See attached file: multicmd)
> 
>   ----------------------------------------------------------------------
>                Name: multicmd
>    multicmd    Type: unspecified type (application/octet-stream)
>            Encoding: base64

-- 
__________________________________________________________________
Eric T. Whiting                                 AMI Semiconductors   
(208) 234-6717                                  2300 Buckskin Road
(208) 234-6659 (fax)                            Pocatello,ID 83201
[EMAIL PROTECTED]

Reply via email to