scp question

Páxina inicial
Anexos:
Mensaxe orixinal
+ (text/plain)
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Kevin Buettner
Data:  
Asunto: scp question
On Sep 11, 2:10pm, Ravi Parimi wrote:

> I dont think ssh -r will copy sub-directories etc...


No, but "scp -r" will. That said, there may still be reasons to prefer
tar (with ssh) over scp. (E.g, tar may do a better job at preserving
certain file attributes than scp -rp.)

> tar cvf - dir/ | ssh "cat > dir.tar" does a great
> job of replicating the directory structure completely onto the remote
> machine...


That just creates a tar file on the remote machine. If you want to
untar it too, you need to do something like:

    tar cf - dir | ssh  "tar -C /path/to/remote/dir xf -"


Kevin