scp question

Inizio della pagina
Allegati:
Messaggio come e-mail
+ (text/plain)
Delete this message
Reply to this message
Autore: Kevin Buettner
Data:  
Oggetto: 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