Copy a file to host: cat FILE|ssh HOST "cat ->FILE'S-LOCATION-ON-HOST"
cat FILE|ssh HOST "cat ->FILE'S-LOCATION-ON-HOST"
Copy a file from a host to current host: ssh HOST "cat FILE"|cat ->FILE'S-LOCATION-ON-CURRENT-HOST
ssh HOST "cat FILE"|cat ->FILE'S-LOCATION-ON-CURRENT-HOST
scp file host:filescp host:file file
to copy multiple files at once, scp -r works, but
tar cf - FILES | ssh host tar xvf -ssh host tar cf - FILES | tar xvf -
is common. On slow connections, you can combine this with compression, e.g. add a 'j' or 'z' option.
For compression you could also use the -C option of ssh or scp. This is gzip compression, like the z option of tar. If you want gzip compression, scp -r -C probably is faster than the tar trick.
I usually use rsync. I can xfer an entire directory structure and only the needed files (changed) are sent over the line.
Comments
scp file host:filescp
by free-zombie | Thu, 2006-07-27 12:36scp file host:filescp host:file file
to copy multiple files at once, scp -r works, but
tar cf - FILES | ssh host tar xvf -ssh host tar cf - FILES | tar xvf -
is common. On slow connections, you can combine this with compression, e.g. add a 'j' or 'z' option.
For compression you could
by tbuitenh | Sun, 2006-07-30 09:12For compression you could also use the -C option of ssh or scp. This is gzip compression, like the z option of tar. If you want gzip compression, scp -r -C probably is faster than the tar trick.
rsync
by waylandbill | Tue, 2006-08-01 15:38I usually use rsync. I can xfer an entire directory structure and only the needed files (changed) are sent over the line.