Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Best way to copy /* ?
Date: Wed, 29 Dec 2010 17:45:10
Message-Id: AANLkTi=jcKqK+os_VdM96A-BdGDay4NzVr_Dw9P2eDKD@mail.gmail.com
In Reply to: Re: [gentoo-user] Best way to copy /* ? by Maciej Grela
1 On Wed, Dec 29, 2010 at 11:14 AM, Maciej Grela <maciej.grela@×××××.com> wrote:
2 > 2010/12/29 Peter Humphrey <peter@××××××××××××××.org>:
3 >> On Monday 27 December 2010 15:47:19 Dale wrote:
4 >>
5 >>> Some people do use tar especially if it is over a network or
6 >>> something like that.  I don't have the command tho since I never
7 >>> used it.
8 >>
9 >> Just for completeness:
10 >>
11 >> (cd [source] && tar cpf - . | (cd [dest] && tar xpf - ) )
12 >>
13 >> (I think).
14 >>
15 >> Would someone here please tell me what the rhs should be if the
16 >> destination is at the other end of a network link?
17 >
18 > On the destination
19 >
20 > root@richese:~# nc -l 5555 | tar -xjv
21 > tar: Rozmiar rekordu = 8 bloków
22 > Pobrane/
23 > Pobrane/Vol 28_16.pdf
24 > Pobrane/EPWA-APP2.flac
25 > Pobrane/EPWA-APP1.flac
26 > root@richese:~#
27 >
28 > On the source:
29 >
30 > thermal@richese:~$ tar -cjv Pobrane/ | nc localhost 5555
31 > Pobrane/
32 > Pobrane/Vol 28_16.pdf
33 > Pobrane/EPWA-APP2.flac
34 > Pobrane/EPWA-APP1.flac
35 > thermal@richese:~$
36 >
37 > Voila !
38
39 I copied several TB over network this way (netcat + tar), when I had
40 no possibility of physically copying data to disks (or removing disks
41 to copy to target machine). It worked perfectly and with a gigabit
42 network link between the two machines it was not so long of a job. :)