Re: chaining ssh commands
From: Nico Kadel-Garcia (nkadel_at_comcast.net)
Date: 09/26/05
- Next message: sukhmeet_at_gmail.com: "How to run a command after logging using a SFTP client.."
- Previous message: Darren Tucker: "Re: chaining ssh commands"
- In reply to: Darren Tucker: "Re: chaining ssh commands"
- Next in thread: Unruh: "Re: chaining ssh commands"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 26 Sep 2005 08:30:54 -0400
"Darren Tucker" <dtucker@gate.dodgy.net.au> wrote in message
news:4337bb95$0$24169$5a62ac22@per-qv1-newsreader-01.iinet.net.au...
> On 2005-09-26, Jacques-Olivier Haenni <jo_no_spam@haenni.info> wrote:
>> This can simply be performed as follows:
>>
>> ssh me@remotebox 'cd /usr/me; tar -xvf me.tar'
>
> Note that if the "cd" fails it will still run the second command.
> In this example it's probably not a big deal, but under other conditions
> it might be.
>
> To prevent that, use "&&" instead, eg:
> $ ssh me@remotebox 'cd /usr/me && tar -xvf me.tar'
Or, in this case:
ssh me@remotebox 'tar xvf -C /usr/me /usr/me/me.tar"
That way, there's only one command to fail and it's usually easier to track
what the failure was.
- Next message: sukhmeet_at_gmail.com: "How to run a command after logging using a SFTP client.."
- Previous message: Darren Tucker: "Re: chaining ssh commands"
- In reply to: Darren Tucker: "Re: chaining ssh commands"
- Next in thread: Unruh: "Re: chaining ssh commands"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|