Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Send the files .. without .. scp

> cd && tar czv src | ssh example.com 'tar xz'

Why would you not want to use scp?

  scp -r src/ example.com:~/target/
does the same thing. Add -C for compression.


Two points:

1. The scp command is not quite the same because it's not maintaining all the file metadata the way that tar is.

2. The examples were mostly intended to be illustrative, showing that you can do things like cd around on the remote machine before receiving/sending the data across the SSH pipe.

My VNC server example near the bottom of the post was a more useful example of the type of thing you can do with SSH that doesn't have another easy solution.


That's faster from my experience than piping. Even faster, use rsync with the ssh option.


alias scp="rsync --progress --partial"

and voila! You can resume big file transfers now.


I'm not into overwriting commands, what if you share you bashrc on a machine without rsync?


Install rsync;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: