parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help on remote ssh cmd


From: p sena
Subject: Re: help on remote ssh cmd
Date: Wed, 10 Jul 2013 11:07:29 -0700 (PDT)


Also, it is to be noted that I cannot remote sql client connect to the server with that username. So I have to copy of the sql file and execute it there remotely only.
Hence the GNU sql may not help here.


From: p sena <senapati2001@yahoo.com>
To: Ole Tange <tange@gnu.org>
Cc: "parallel@gnu.org" <parallel@gnu.org>
Sent: Wednesday, July 10, 2013 10:15 PM
Subject: Re: help on remote ssh cmd


Ole ,

This does not work.

cat host |parallel -j2 rsync -Hav /home/User/xxx.sql {}:/home/User/xxx.sql \;"ssh {} hostname \\\&\\\& /bin/mysql --user=root --password=password DB </home/User/xxx.sql"
sh: ./\: Permission denied
sh: /home/User/xxx.sql: No such file or directory
building file list ... done

sent 92 bytes  received 20 bytes  20.36 bytes/sec
total size is 677  speedup is 6.04
sh: ./\: Permission denied
sh: /home/User/xxx.sql: No such file or directory
building file list ... done

sent 92 bytes  received 20 bytes  20.36 bytes/sec
total size is 677  speedup is 6.04
 
If i remove the " near the ssh {} then also it fails saying that file xxx.sql not found (on localhost). I see the file is rsynced. but command fails to run.

thanks.

----- 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]