Re: The tar trick !!!
- From: jellybean stonerfish <stonerfish@xxxxxxxxxxxxx>
- Date: 08 Jun 2009 02:00:52 GMT
On Sun, 07 Jun 2009 22:38:25 +0100, Chris Davies wrote:
Robert Heller <heller@xxxxxxxxxxxx> wrote:
tar cf - myfile . | ssh anna@server1 'cd /home/anna/server1; tar xvf -
' Although this is also wrong ('myfile' will get copied twice).
If the cd on the remote end fails, the tar will extract to the user's
home directory - not necessarily what you want. You can handle this by
using the && construct. As a further potential optimisation, given the
assumption that anna@server1 has a home directory of /home/anna, you can
combine the two and use this:
tar cf - . | ssh anna@server1 'cd server1 && tar xvf -'
Is the "cd server1" needed?
tar -cf - . | ssh anna@server1 'tar -xv -C server1 -f -'
.
- Follow-Ups:
- Re: The tar trick !!!
- From: Chris Davies
- Re: The tar trick !!!
- References:
- The tar trick !!!
- From: zodiac
- Re: The tar trick !!!
- From: Grant Edwards
- Re: The tar trick !!!
- From: annalissa
- Re: The tar trick !!!
- From: Robert Heller
- Re: The tar trick !!!
- From: annalissa
- Re: The tar trick !!!
- From: Robert Heller
- Re: The tar trick !!!
- From: Chris Davies
- The tar trick !!!
- Prev by Date: Re: Palm Pre
- Next by Date: Re: The tar trick !!!
- Previous by thread: Re: The tar trick !!!
- Next by thread: Re: The tar trick !!!
- Index(es):
Relevant Pages
|