----- Original Message -----
From: Ole Tange <tange@gnu.org>
To: p sena <senapati2001@yahoo.com>
Cc: "parallel@gnu.org" <parallel@gnu.org>
Sent: Tuesday, July 9, 2013 10:58 PM
Subject: Re: help on remote ssh cmd
On Tue, Jul 9, 2013 at 5:58 AM, p sena <
senapati2001@yahoo.com> wrote:
> Seemed both the commands didn't worked ? But the way I showed you it worked
> ( parallel -j 1 --basefile some-file-2-copy -S H1,H2 ::: "hostname &&
> /home/username/that-file-copied" "hostname &&
> /home/username/that-file-copied") , is that way Ok, is
it doing the
things
> parallel ?
-j1 forces to run one job per host.
While the above will probably run "hostname &&
/home/username/that-file-copied" on both, that is not necessarily true
if you have many hosts: If the command finishes on H1 before GNU
Parallel gets the command started on H100, then GNU Parallel may start
it on H1 instead.
So what you are doing does not scale and may cause problems.
This guarantees what you want:
cat hosts.txt | parallel -j10 rsync -Hav
/home/username/that-file-copied {}:/home/username/that-file-copied \;
ssh {} hostname \\\&\\\& /home/username/that-file-copied
/Ole