On Thursday 23 March 2006 16:31, Bo Andresen <[EMAIL PROTECTED]> wrote 
about 'Re: [gentoo-user] How to tar?':
> Perhaps that link wasn't as useful to you as I thought when I
> transmitted it. Here are a couple of other examples. I think it requires
> GNU tar.
>
> This compacts data recursively from /from/path and using gzip, pipes it
> through ssh and extracts it into /to/path:
> # tar -zcf - /from/path | ssh desktop.homelinux.com "tar -C /to/path
> -xzf -"

Or, for non-GNU tar:
tar cf - /from/path | gzip -c | ssh desktop.homelinux.com 'cd /to/path; 
gunzip -c | tar xf -'
(Some non-gnu tars probably don't even need the 'f -' parts...)

> And this just pipes through ssh and extracts using bunzip2 to /to/path
> on remote machine
> # cat file.tar.bz2 | ssh desktop.homelinux.com "tar -C /to/path -xjf -"

Or for non-GNU tar without the unnecessarily spawned process:
ssh desktop.homelinux.com 'cd /to/path; bunzip2 -c | tar xf -' < 
file.tar.bz2

(Each of my examples is meant to be a single line.)

-- 
"If there's one thing we've established over the years,
it's that the vast majority of our users don't have the slightest
clue what's best for them in terms of package stability."
-- Gentoo Developer Ciaran McCreesh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to