1 |
Peter Humphrey writes: |
2 |
|
3 |
> On Wednesday 29 December 2010 17:50:08 Alex Schuster wrote: |
4 |
> > What Maciej said. Or, for greater security when the destination is |
5 |
> > outside the LAN: |
6 |
> > |
7 |
> > cd [source] & tar xpf - . | ssh [user]@[host] 'cd [dest] && tar xpf |
8 |
> > -' |
9 |
> |
10 |
> That's what I was looking for - a single command I can run on the source |
11 |
> machine. Thanks Alex. |
12 |
> |
13 |
> Just one more thing - what if I only want to store the tar of the source |
14 |
> directory as an archive on the remote machine? In that case I'd want to |
15 |
> stream the incoming data into a file instead of untarring it. |
16 |
|
17 |
Replace the tar by cat, and redirect into a file: |
18 |
|
19 |
cd [source] & tar xpf - . | ssh [user]@[host] 'cat > [dest]/[name].tar' |
20 |
|
21 |
Wonko |