Loading
 

Need to transer a whole disk image to another computer over SSH?

Just:
dd if=/dev/sda | ssh user@host "dd of=/directory/imagefile"

or with compression:
dd if=/dev/sda | bzip2 |ssh user@host "dd of=/directory/imagefile"

or with compression on the receiving side:
dd if=/dev/sda | ssh user@host "bzip2 | dd of=/directory/imagefile"

This example can be expanded easily as:
cat filename |ssh user@host "dd of=/directory/filename"

also works quite fine.
Actually anything that can produce output stdout can be piped to another computer.

mysqldump:
mysqldump mysql -p | ssh user@host "lzma -2 | dd of=/directory/tst.lzma"

or tar:
tar zcvf - dir-to-be-tarred/ | ssh user@host "dd of=/directory/tst.tar.gz"

Life of a piper man is amazing, isn’t it?

Related posts:

  1. SSH Port Forwarding

  2 Responses to “Data Copy Over SSH”

  1. I’m using rsync for this purpose. also for saabnet.ee daily incremental backup.

  2. Rsync is a really good tool. Specially for backup or for preserving file attributes. Sometimes it is a bit of overkill though.

     

     

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
© 2011 Ogalik OÜ info@ogalik.ee Suffusion theme by Sayontan Sinha